linux - awk OR statement -
does awk have or
statement i.e given following snippet:
awk '{if ($2=="abc") print "blah"}'
is possible add or
statement if $2==abc or def -> print
?
yes. there's logical or ||
can use:
awk '{if ($2=="abc" || $2=="def") print "blah" }'
Comments
Post a Comment