ITeye博客

UNIX: DOS To UNIX

jacky · 2009-08-26 11:58 · shell · Markdown

Features:

  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

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。