Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the '...with sed...' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
...with sed...
Authored by: louisg on Nov 26, '01 05:41:10PM

>for i in `jot 10 1`; do mv 2001-05-26-phish-d1t$i.shn ph01-05-26d1t$i.shn; done

You could also have...

for i in `ls 2001-05-26-phish-d1t*shn` ; do
echo $i | sed 's/2001-05-26-phish-d1t/ph01-05-26d1t/' | read newname
mv $i $newname

This method may work better in general because we don't always have filenames that contain sequential numbers.

The guys still using File Buddy will notice that these classic Mac programs have a long way to go before they can match the power of the shells, sed, awk and yes, lets not forget, jot!


[ Reply to This | # ]