Answers for "or in awk"

0

awk or

awk '{
	if ( $2 == "abc" || $2 == "def") {
    	print "blah"
    }
}'
Posted by: Guest on September-17-2021
1

awk or statement

# Basic syntax:
||

# Example usage:
awk '{if ($2=="abc" || $2=="def") print "true"}' input_file
# I.e. if the second field equals "abc" OR "def", awk with print "true"
Posted by: Guest on September-10-2020

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language