Perl One Liners
Eat Trailing Spaces in Records:
perl -l -pi -e ‘s/ +$//’ <FILENAME>
Join every 2 lines in a file:
perl -pi -e ‘if ($. %2){ chomp } else { s/^// }’ <FILENAME>
Strip certain unprintable characters (hexadecimal) from file:
perl -l -pi -e ‘s/\xHH+//’ <FILENAME>
0 comments