Skip to main content
`777` is the ”argument“ for `-0`
Source Link
perl -0777pe 's/\R?$/\n/' file

-0777 without arguments is equivalent to no record separator (treat the whole file as a single line), so $ equals EOF not EOL.

\R is equivalent at CRLF (Windows) or LF (Linux) or CR (MAC).

perl -0777pe 's/\R?$/\n/' file

-0777 without arguments is equivalent to no record separator (treat the whole file as a single line), so $ equals EOF not EOL.

\R is equivalent at CRLF (Windows) or LF (Linux) or CR (MAC).

perl -0777pe 's/\R?$/\n/' file

-0777 is equivalent to no record separator (treat the whole file as a single line), so $ equals EOF not EOL.

\R is equivalent at CRLF (Windows) or LF (Linux) or CR (MAC).

added 3 characters in body
Source Link
perl -0777pe 's/\R?$/\n/' file

-00777 without arguments is equivalent to no record separator (treat the whole file as a single line), so $ equals EOF not EOL.

\R is equivalent at CRLF (Windows) or LF (Linux) or CR (MAC).

perl -0777pe 's/\R?$/\n/' file

-0 without arguments is equivalent to no record separator (treat the whole file as a single line), so $ equals EOF not EOL.

\R is equivalent at CRLF (Windows) or LF (Linux) or CR (MAC).

perl -0777pe 's/\R?$/\n/' file

-0777 without arguments is equivalent to no record separator (treat the whole file as a single line), so $ equals EOF not EOL.

\R is equivalent at CRLF (Windows) or LF (Linux) or CR (MAC).

added 3 characters in body
Source Link
perl -0pe0777pe 's/\R?$/\n/' file

-0 without arguments is equivalent to no record separator (treat the whole file as a single line), so $ equals EOF not EOL.

\R is equivalent at CRLF (Windows) or LF (Linux) or CR (MAC).

perl -0pe 's/\R?$/\n/' file

-0 without arguments is equivalent to no record separator (treat the whole file as a single line), so $ equals EOF not EOL.

\R is equivalent at CRLF (Windows) or LF (Linux) or CR (MAC).

perl -0777pe 's/\R?$/\n/' file

-0 without arguments is equivalent to no record separator (treat the whole file as a single line), so $ equals EOF not EOL.

\R is equivalent at CRLF (Windows) or LF (Linux) or CR (MAC).

Source Link
Loading