unix ksh file rename

June 23, 2011 at 10:43:17
Specs: Windows XP
Help please, I have multiple files in a folder that end with .999.dat, I need to rename the files to "filename.dat" (need to get rid of the .999) ie file name payroll123a.999.dat need to rename to payroll123a.dat. thanks

See More: unix ksh file rename

Report •

#1
June 23, 2011 at 12:08:35
#!/bin/ksh

cd <to_your_directory>

for i in *\.999.dat
do
   mv $i `echo "$i"|sed 's/\.999//g'`
done


Report •

#2
June 24, 2011 at 03:32:57
Nails

We see your name a lot on this fine site helping other people, we would like to thank you for all your help and support. Thank you


Report •

#3
June 24, 2011 at 10:10:45
John:

You're welcome. And thank you for the kind words. I appreciate it.

Regards,

nails


Report •
Related Solutions


Ask Question