Last active
December 16, 2015 21:09
-
-
Save ynonp/5497555 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Program 1 -- print the third column of each line | |
perl -pe '$_ =perl -ane 'print $F[2], "\n"' | |
# Program 2 -- treat each line as a number and sum all lines | |
perl -pe '$\+=$_}{' | |
# Program 3 -- print an empty line after each line | |
perl -pe '$\="\n"' | |
# Program 4 -- number the lines | |
perl -pe '$_="$.$_"' | |
# Program 5 -- print everything between START and END | |
perl -ne 'print if /START/../END/' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment