![]() |
Re: Your Favorite Apps/Mods NOT In Repositories
Okay, I'll give it a try. Thanks!
Oh, and what if I want to gag multiple outputs such as llib pianobar | grep -v "|>" "(i) Receiving new playlist... Ok."? I don't know how to add a second filter to that grep command, and yes, I looked online for about 30 minutes on this already and couldn't find it. |
Re: Your Favorite Apps/Mods NOT In Repositories
This almost worked. :)
llib pianobar | grep -v "|>" Instead of gagging just those two character symbols, it mutes out the entire line all together. Is there a better way to use that grep command? |
Re: Your Favorite Apps/Mods NOT In Repositories
Okay. At least this a good start. :)
llib pianobar | grep -v "(i) Receiving new playlist... Ok." Now it only shows the songs that have played making the output in Xterm a little less messy. All I would like is to also get rid of all the "|> " and """ characters as well if this is possible. Thanks Andy. :) |
Re: Your Favorite Apps/Mods NOT In Repositories
Quote:
command | sed 's/|>//' > outfile.txt Would remove the first "|>" sequence it found in each line. If you want to remove *all* such, it's 's/|>//g' (g suffix to sed substitute command). sed can also remove whole lines: command | sed '/foobar/d' Matches line with "foobar" within them and deletes them. I point this out because sed can run with a whole list of rules (provided by a file) and thus can probably do all your folding, spindling, and mutilating with a single "sed" command. If the file cleanup.sed had the two lines: /Receiving/d s/|>//g Then running it with: command | sed -f cleanup.sed > output.txt Would both trim off lines with "Receiving" as well as remove the character sequence |> (without otherwise changing the line). Andy |
Re: Your Favorite Apps/Mods NOT In Repositories
I'm confused. :)
This seems to kind of work.... PATH=$PATH:/usr/local/bin llib pianobar | sed 's/|> //' That's 2 spaces after /> and not just 1. The thing is it won't display the song now until after it has finished playing. No big deal I guess. Anyway, can you help me pipe all of these exceptions together? llib pianobar | sed 's/|> //' | sed 's/ "//' | grep -v "(i) Receiving new playlist... Ok." | grep -v "Station" If I try and do more than one filter, Xterm just hangs without doing anything. I'm not sure what I'm doing wrong on this. Cheers. :) |
Re: Your Favorite Apps/Mods NOT In Repositories
Quote:
Andy |
Re: Your Favorite Apps/Mods NOT In Repositories
Dang it I'm super dumb. :(
llib pianobar | sed -u 's/|> //' sed: invalid option -- u llib pianobar | sed 'u/|> //' sed: unsupported command u llib pianobar | sed '/|> //u' sed: unsupported command / How do you use the -u option? |
Re: Your Favorite Apps/Mods NOT In Repositories
Quote:
www.vsta.org/andy/pickup/n810_sed Probably you shouldn't scribble on top of the Busybox one, just put this one in /usr/local/bin/sed (or /usr/local/bin/gsed to be really defensive) and it definitely has the -u option. Andy |
Re: Your Favorite Apps/Mods NOT In Repositories
Thanks!
Okay, once last thing, how do I string these all together? llib pianobar -u | sed 's/|> //' | sed -u 's/ "//' | grep -v "(i) Receiving new playlist... Ok." | grep -v "Station" Am I using the pipe command correctly? |
Re: Your Favorite Apps/Mods NOT In Repositories
Quote:
s/|> // s/"//g /Receiving new playlist/d /Station/d In one file, say "filter.sed". Then run pianobar as: llib pianobar | sed -u -f filter.sed I don't think pianobar looks at its command line arguments, so I left off that -u you had put for pianobar. Andy |
All times are GMT. The time now is 19:18. |
vBulletin® Version 3.8.8