How to extract string from filename solved

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

Thanks very much to all of you.  I modified the script posted by Willam and it now does what I want.  Yes, scripting is educational.  I found out about rev which I didn't know about before.  Here is the final script.  It seems to do what I want and I'm very greatful.  Thanks to all of you for your excellent suggestions!  I saved most of them.

#!/bin/bash   
 
#Since there are no spaces in the names, use for loop 
 
for i in $(ls *mp3);do 
 
grab=`echo $i|rev|cut -f2 -d'_'|rev` 
 
 wget -q http://www.bbc.co.uk/programmes/$grab  -O"`basename $i .mp3`.html"
  done 

_______________________________________________
Blinux-list mailing list
Blinux-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/blinux-list



[Index of Archives]     [Linux Speakup]     [Fedora]     [Linux Kernel]     [Yosemite News]     [Big List of Linux Books]