mirror of
https://github.com/Erreur32/cheat.git
synced 2024-12-22 05:32:13 +01:00
Merge pull request #363 from shigemk2/shigemk2-patch-1
Add cheatsheet perl
This commit is contained in:
commit
d09353bfca
1 changed files with 8 additions and 0 deletions
8
cheat/cheatsheets/perl
Normal file
8
cheat/cheatsheets/perl
Normal 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"
|
Loading…
Reference in a new issue