First commit ~0,10
This commit is contained in:
36
G/DOS2UNIX
Normal file
36
G/DOS2UNIX
Normal file
@ -0,0 +1,36 @@
|
||||
#!/bin/csh -f
|
||||
#
|
||||
# Gershon Elber, Feb 90.
|
||||
#
|
||||
|
||||
set upcase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
set locase = "abcdefghijklmnopqrstuvwxyz"
|
||||
|
||||
echo
|
||||
echo +++++ Rename directories:
|
||||
echo
|
||||
foreach d (`find . -type d -print`)
|
||||
set new_d = `echo $d | tr $upcase $locase`
|
||||
|
||||
if ( "$d" != "$new_d" ) then
|
||||
echo $d to $new_d
|
||||
mv $d $new_d
|
||||
endif
|
||||
end
|
||||
|
||||
echo
|
||||
echo +++++ Rename files, strip CR/LF to LF and remove DOS ^Z:
|
||||
echo
|
||||
foreach f (`find . -type f -print`)
|
||||
set new_f = `echo $f | tr $upcase $locase`
|
||||
echo $f to $new_f
|
||||
|
||||
tr -d "\015\032" < $f > $new_f.tmp
|
||||
rm -r $f
|
||||
mv $new_f.tmp $new_f
|
||||
end
|
||||
|
||||
#
|
||||
# Do small fixes manually.
|
||||
#
|
||||
(chmod +x dos2unix make-unx test-unx)
|
Reference in New Issue
Block a user