trying to delete a line with sed [SOLVED]
Hi,
I'm working on a script to kill a current song being played by ogg123, and I have gotten as far as retrieving the location of the song. It is stored in a text file (playlist) in this format: Quote:
Code:
CURRENT_SONG=`tail nohup.out | grep "Playing:" | cut -c 12-500` I am able to get the current song without any trouble, but am not sure how to use sed to delete the current song from the playlist. Here is the script (sed part is not working): Code:
#!/bin/sh Help would be great, because sed is alien to me. Thanks. |
There's a page of handy sed one-liners that may help, but to me the easiest way seems to be using grep. Usually, grep prints matching lines; you can give it the -v option to print only lines that don't match:
Code:
grep -v "$CURRENT_SONG" "$PLAYLIST" > "$PLAYLIST" |
grep saves the day
Quote:
Thanks for replying! |
All times are GMT -5. The time now is 03:47 PM. |