cheat-fork-echo/cheat/cheatsheets/perl
Michihito Shigemura 0b0bc441c6
Add cheatsheet perl
2017-11-20 21:20:22 +09:00

9 lines
222 B
Plaintext

# To view the perl version:
perl -v
# Replace string "\n" to newline
echo -e "foo\nbar\nbaz" | perl -pe 's/\n/\\n/g;'
# Replace newline with multiple line to space
cat test.txt | perl -0pe "s/test1\ntest2/test1 test2/m"