in reply to crlf to \n

I transfer files between OS's on fairly regular basis. My solution is to just run the following one-liner as part of the transfer procedure - that way it doesn't matter what I feed it into on the far end.

perl -pi -e 's/\r\n/\n/;' filename

Information on the command-line switches above is found in perlrun.

Replies are listed 'Best First'.
Re^2: crlf to \n
by codeacrobat (Chaplain) on Apr 02, 2009 at 23:10 UTC
    or just:
    perl -pi -e 'tr[\r][]d' environments.txt

    print+qq(\L@{[ref\&@]}@{['@'x7^'!#2/"!4']});