OT: Changing filename case and EOL characters.
David Niemi
drn_temp2 at rogers.com
Thu Jul 28 21:24:05 UTC 2005
With the help of the group a few months ago I was pointed towards a
routine which would change the case of filenames for me:
#!/bin/bash
# program to change the case
# of filenames
#
for f in *
do
F="`echo $f | tr a-z A-Z`"
echo Renaming \"$f\" to \"$F\"
mv "$f" "$F"
done
**************
Now I think I need to change the end-of-line characters from DOS to
Linux / unix. I searched and found this:
sed s/.$// consult.TAB >consult2.TAB
which works but I also need to do this to about 620 files to ensure that
they are using the proper EOL. These are all fortran 95 program files
so I don't want to actually change the filenames, but fortran expects
uppercase.
Would this work?
***************
for f in *
do
F="`echo $f | tr a-z A-Z`"
echo Renaming \"$f\" to \"$F\"
sed s/.$// "$f" > "$F"
done
*****************
Thanks
More information about the fedora-list
mailing list