#! /bin/shdostype=dosIFS=$(echo -en "\n\b")function iterate_dir(){for file in $1/*; doif [ -f $file ]; thentypename=`file $file | grep -q CRLF && echo dos || echo unix`if [[ $typename == $dostype ]]; thensed -i "s/.$//g" $fileecho 'converting '$fileelse:fielseiterate_dir $filefidone}if [ "$1" == "" ]; thenecho 'convering start'`pwd`iterate_dir .elseecho 'convering start'$1iterate_dir $1fi
shell脚本 dos格式转unix
最新推荐文章于 2023-11-15 10:51:47 发布