[Nepal] question about mass file renaming w/ bash script
Bryan Berry
bryan at olenepal.org
Tue Sep 2 01:08:52 EDT 2008
Bernie, you showed me on Sunday how to mass rename files w/ sed
here is what I remember:
find . -name '*.txt' | sed 's/\(*\).txt/mv \1.txt \1.doc/' | bash
but I can't get this to work. for some reason sed isn't matching
anything that find pipes to it.
Any ideas?
---> 10 minutes later
Figured it out, need to match that damn leading period!
This works
find . -name '*.txt'| sed 's/\(.*\).txt/mv \1.txt \1.doc/'| bash
alright, and it only took 1.5 hours to figure out!
--
Bryan W. Berry
Systems Engineer
OLE Nepal, http://www.olenepal.org
More information about the Nepal
mailing list