Features:
1. Convert window format to UNIX format
2. Keep the last modify date of file unchanged
1. Convert window format to UNIX format
2. 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
本文介绍了一个脚本,用于将Windows格式的文件转换为UNIX格式,并保持文件的最后修改日期不变。通过使用tr命令去除回车符,并利用touch命令复制原始文件的日期属性。
1253

被折叠的 条评论
为什么被折叠?



