Author: Alan Fox
Date: 23-02-02 19:50
Based on the last (good, working) perl script, I wrote a quick shell script that does all this for me.
The contents of the shell script are as follows:
perl -p -i -e 's/\r\n/\n/s' $*
I named this script "dos2unix", placed it in the /usr/local/bin directory, and ran a quick "chmod 755 dos2unix" to get it working.
Just type "dos2unix file1.txt file2.txt ...", and it happily does its stuff.
The filename is optional. The name dos2unix collides with the name of another handy utility, also mentioned in this forum topic. I only named it "dos2unix" because I am used to dealing with that utility on Solaris systems, and I would not have to memorize any extra tool names. Note, by the way, that the usage of this tool differs from the original dos2unix.