Add cheatsheet perl

This commit is contained in:
Michihito Shigemura 2017-11-20 21:20:22 +09:00 committed by GitHub
parent cdf573a725
commit 0b0bc441c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

8
cheat/cheatsheets/perl Normal file
View File

@ -0,0 +1,8 @@
# 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"