Difference between revisions of "awk scripting notes"

From thelinuxwiki
Jump to: navigation, search
(Created page with " compound logical statement $ echo "1 2 3" | awk '{for (i=1; i<=NF; i++) if (($i=="1") && ($(i+1)=="2")) print $(i+2)}' 3")
 

Latest revision as of 23:03, 5 August 2018

compound logical statement

$ echo "1 2 3" | awk '{for (i=1; i<=NF; i++) if (($i=="1") && ($(i+1)=="2")) print $(i+2)}'
3