Dos2unix

From wikipost
Revision as of 01:39, 20 January 2013 by Admin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

A simple but effective script that strips out the /r (Carriage Return) character from DOS-based text files so that you don't see ^M at the end of every line when viewing under linux.


#!/bin/sh

echo "dos2unix"
for file in "$@"
do
  tr -d "\r" <$file>$file.unix
done