Skip to content

Instantly share code, notes, and snippets.

@Jaskirat
Created March 19, 2012 10:29
Show Gist options
  • Save Jaskirat/2106820 to your computer and use it in GitHub Desktop.
Save Jaskirat/2106820 to your computer and use it in GitHub Desktop.
Pyp/Awk/Sed at al
#PYP
ls -l | pyp "pp[5:11:2] | whitespace[2], w[-1] | p.replace('hello','goodbye') | p.title(),'is splendid'"
#AWK/SED
ls -l | awk 'NR>=5 && NR<11 {print $3,$9}' | sed 'n;d' | sed -e 's/hello/goodbye/g' -re 's/(^| )([a-z])/\1\u\2/g' -e 's/$/ is splendid/'
#Also using Record stream
ls -l |awk 'NR>=5 && NR<11' | sed 'n;d'|sed -r 's/\s+/,/g'| sed 's/hello/goodbye/g' | recs-fromcsv | recs-eval 'ucfirst({{2}})." ".ucfirst({{8}})." is splendid"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment