UNIX: DOS To UNIX
Features:
- Convert window format to UNIX format
- Keep the last modify date of file unchanged
if [ $# -ne 1 ];then
echo
echo "USAGE: $0 fileName"
echo
exit -1
fi
file=$1
tr -d '\r' <$file >$file.tmp
touch -r $file $file.tmp
mv $file.tmp $file
chmod 777 $file