dos2unix.sh

#!/bin/sh
foreachd () {
echo $1
for file in $1/*
do
if [ -d $file ]
then
echo "directory $file"
foreachd $file
fi

if [ -f $file ]
then
echo "file $file"
dos2unix $file
chmod -x $file
fi

done
}

echo $0
a=`echo $1`
if [ $# -gt 0 ]
then
foreachd $a
else
foreachd "."
fi

 

posted @ 2017-04-27 20:42  JustRelax  阅读(129)  评论(0编辑  收藏  举报