View previous topic :: View next topic |
Author |
Message |
kleinishere n00b
Joined: 23 Nov 2003 Posts: 37
|
Posted: Sun Nov 07, 2004 8:04 pm Post subject: i don't think there is an easier question on this forum |
|
|
i am trying to cut off the first 29 letters that the command "xmmsctrl cur" gives me and output it to a file. could someone please help me.
right now i have this:
Code: | #!/bin/sh
#please work
song="xmmsctrl cur"
echo ${song:29} |
As i guess many of you know this is just setting song to the string "xmmsctrl cur" and not to the output of the command. i know php, but not how to make linux scripts. i also need to know how to write this to a file, say /home/klein/.gaim/xmmssong. if you could help i would appreciate it sooo much. thanks,
michael _________________ Pain is weakness leaving the body. |
|
Back to top |
|
|
blue.sca l33t
Joined: 28 Aug 2003 Posts: 680 Location: Mainz, Germany
|
Posted: Sun Nov 07, 2004 8:23 pm Post subject: |
|
|
try Code: | song="`xmmsctrl cur`" |
for writing to a file, there are several flow control methods, best would be Code: | ./nameofscript > nameoffile |
_________________ geek by nature, linux by choice
i want my avatar back... thank you
:wq |
|
Back to top |
|
|
papal_authority Veteran
Joined: 31 Mar 2004 Posts: 1823 Location: Canada
|
Posted: Sun Nov 07, 2004 8:24 pm Post subject: |
|
|
Code: |
#!/bin/sh
xmmsctrl cur | cut -c1-29 > /home/klein/.gaim/xmmssong
|
_________________ The free market gave me gonorrhea. |
|
Back to top |
|
|
|