The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 10-03-2006
happyv happyv is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 209
please help - script to list and rename

Hi Friend,

I have a small script to list all file FFAAAAABBBBB00001 and FFAAAAABBBBB00001.repaired (when I run another script, the orginal file will output another *.repaired file) in my unix directory, and reaname the output file FFAAAAABBBBB00001.repaired back to FFAAAABBBBB00001. However, it have some strange message below:

mv: illegal option -- r
mv: illegal option -- w
mv: illegal option -- x
mv: illegal option -- r

The script is:
echo Please input firstcodelist:
read firstcodlist
for filename in `ll FF$firstcodelist*`
do
mv $filename `echo $filename | cut -c 1-17`
done


can you help to modify or any other new good script for me?

Thank you all!!!