OT: Changing filename case and EOL characters.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux