Mac to Unix: perl -i -pe 's/\015/\012/g' mac-file Mac to DOS: perl -i -pe 's/\015/\015\012/g' mac-file Unix to Mac: perl -i -pe 's/\012/\015/g' unix-file Unix to DOS: perl -i -pe 's/\012/\015\012/g' unix-file DOS to Unix: perl -i -pe 's/\015\012/\012/g' dos-file DOS to Mac: perl -i -pe 's/\015\012/\012/g' dos-fileHere are a few more possibilities from Jacek Artymiak's Filtering files with tr:
Mac -> UNIX: tr '\r' '\n' < macfile > unixfile UNIX -> Mac: tr '\n' '\r' < unixfile > macfile DOS -> UNIX: tr -d '\r' < dosfile > unixfile UNIX -> DOS: '{ print $0"\r" }' < unixfile > dosfile
/nix | Nov 08, 2009