Creates PodFeeds.txt, a file that lists the URLs of rhythmbox podcasts from the rhythmdb.xml file.

grep -A 5 -e podcast-feed rhythmdb.xml | grep -e "<location>" | sed 's: *</*[a-t]*>::g' > PodFeeds.txt
The first grep any line with pod-feed in it plus the following five lines. The second grep throws out any line not containing . sed removes the leading four spaces then and the trailing . Using a colon as sed's separating character avoids having to escape the /. Works ok with Mythbuntu 9.04 (used mostly as a three line bash script).
Sample Output
dogflap@dogflap-desktop:~/Desktop$ cat PodFeeds.txt
http://leoville.tv/podcasts/mbw.xml
http://www.abc.net.au/rn/podcast/feeds/science.xml
http://www.abc.net.au/rn/podcast/feeds/lnl.xml
http://leoville.tv/podcasts/floss.xml
http://www.tuxradar.com/files/podcast/podcast_ogg.rss
http://rssnewsapps.ziffdavis.com/audioblogs/crankygeeks/cg.audio.xml
http://www.nature.com/nature/podcast/rss/nature.xml
http://leoville.tv/podcasts/twit-ogg.xml
http://distrowatch.com/news/podcast.xml
http://leoville.tv/podcasts/sn.xml
http://downloads.bbc.co.uk/podcasts/radio4/fricomedy/rss.xml

1
By: dogflap
2010-05-22 05:50:45

What Others Think

In the description elements in angle brackets have not appeared. I'll try now with quotes. line 3 ends 'not containing ""' line 4 ends 'the trailing ""' Best regards dogflap.
dogflap · 830 weeks and 1 day ago
Well that attempt to get angle brackets into the description did not work. Third try. Line 3 ends in "location" enclosed in angle brackets. Line 4 should end in "/location" enclosed in angle brackets. best regards dogflap
dogflap · 830 weeks and 1 day ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: