On Oct 17, 2005, at 1:45 PM, Ed Howland wrote:
Let me know which is easier. BTW, the index command returns the offset
of the '@' in the line. I felt split would work better. This in similar
in both perl and ruby.

Here's a stripped-down version that gets the list of mp3 files:

( cat << eof
[EMAIL PROTECTED]://www.abc.net.au/rn/podcast/feeds/mind.xml
eof
) | while read podcast ; do
        number=$(expr "$podcast" : '[EMAIL PROTECTED]@')
        podcastURL=${podcast:$number}
wget -q $podcastURL -O - | tr '\r' '\n' | tr \' \" | sed -n 's/.*url="\([^"]*\)".*/\1/p'
done

Changes:
- back-ticks replaced with $()
- 'expr index' replaced with ":" -- more portable between BSD, OS X, and GNU/Linux
- cat at beginning of while loop
- uses a here document. Just add the feeds between the 'cat' and the 'eof'

I agree with your comment about split.  I wish bash had it.

Regards,
- Robert
http://www.cwelug.org/downloads
Help others get OpenSource software.  Distribute FLOSS
for Windows, Linux, *BSD, and MacOS X with BitTorrent


_______________________________________________
CWE-LUG mailing list
[email protected]
http://www.cwelug.org/
http://www.cwelug.org/archives/
http://www.cwelug.org/mailinglist/

Reply via email to