Linefeed( )をCarriage Return+LineFeedLineFeed.sh
に変換する機能を実行するという名前のシェルスクリプトファイルがあります。LF
Windowsのバッチファイルでも同じことをしたいと思います。出来ますか?
Linuxシェルファイル
E_WRONGARGS=65
cat OutputList|while read -r Line
do
if [ -z "$Line" ]
then
echo "Usage: `basename $0` filename-to-convert"
exit $E_WRONGARGS
fi
NEWFILENAME=$Line.unx
CR='\015' # Carriage return.
# 015 is octal ASCII code for CR.
# Lines in a DOS text file end in CR-LF.
# Lines in a UNIX text file end in LF only.
tr -d $CR < $1 > $NEWFILENAME // here its deleting CR but i need to append LF
# Delete CR's and write to new file.
done
echo "Original DOS text file is \"$1\"."
echo "Converted UNIX text file is \"$NEWFILENAME\"."
exit 0