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

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -