dos2unix
Single Command Wrapper Script
perl -pi -e ‘s/\\r//’ [file]
#!/bin/sh
# Copy to /usr/local/bin/dos2unix
if [ “$1” = “” ]; then
echo Usage: `basename $0` [filename]
exit
fi
# Convert to Unix format.
perl -pi -e ‘s/\\r//’ $1
unix2dos
Single Command Wrapper Script
perl -pi -e ‘s/\\r//; s/\\n/\\r\\n/’ [file]
#!/bin/sh
# Copy to /usr/local/bin/unix2dos
if [ “$1” = “” ]; then
echo Usage: `basename $0` [filename]
exit
fi
# Force to Unix format first…
perl -pi -e ‘s/\\r//’ $1
# …and then convert to DOS.
perl -pi -e ‘s/\\n/\\r\\n/’ $1
Recent Comments