shell脚本批量转文件格式:dos2unix

文章目录


可以使用shell脚本实现:

#!/bin/sh

dir=$PWD
if [ $# -gt 1 ]
then
    howUsage
fi
if [ $# -gt 0 ]
then
    dir=$1
fi


for i in `find $dir`
do
    if [ ! -d $i ]
    then
        echo "processing file..." $i
        dos2unix $i $i
    fi
done

howUsage()
{
    
    
    echo "Usage: dos2unix dir [destdir]"
    exit 0
}

猜你喜欢

转载自blog.csdn.net/u014163312/article/details/129821085