Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ingmarioalberto/46284ab01df4adc9bd5909324a88bacb to your computer and use it in GitHub Desktop.
Save ingmarioalberto/46284ab01df4adc9bd5909324a88bacb to your computer and use it in GitHub Desktop.
acordeón awk
awk
Separator:--> -F ":"
columnas 1,3,última:--> '{print $1" "$3" "$NF}'
awk
Separator:--> -F ":"
sum column 3:--> '{s=s+$3}END{print s}'
awk
regex en var GG:--> GG="[0-9]+"
if col2 like regex:--> '{if ( $2 ~ GG ){ print $0; }}'
awk
if col2=LINUX print all '$2 == "LINUX" { print $0 }'
awk
print col4 w/out lastchar '{print substr($4,1,length($4)-1)}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment