I am bit stuck with this how do I check all keyword should exist in my text
If any one keyword is not present then it should return me status : 1 or else 0
keyword='CAP\|BALL\|BAT\|CRICKET'
echo "HE AS CAP AND LOVE TO PLAY BALL BAT , ITS IS CALLED CRICKET"
My code :
echo "HE AS CAP AND LOVE TO PLAY BALL BAT , ITS IS CALLED CRICKET" | grep -w "$keyword"
echo $?
With your shown samples and attempts, please try following
awkcode. Written and tested in GNUawk, should work in any version ofawk.Explanation: Adding detailed explanation for above code.