FILENAME#current file nameFNR#record number in current fileFS#field delimiterRS#record delimiterNF#field number in current recordNR#records number till nowawk'matchpattern{action}'awk'/101/'#regexp match the line that has 101awk'$1==5'#match the line that the value of first column equal 5awk'/$1/'#match the line that has $1, which is bash parameter passed from aboveawk'$1*$2>100'#match the line that column 1 multiply column 2 greater than 100awk'$2>5&&$2<=15'#match line according to its logicawk'/100/{print$1}'#print column 1 if that line has string of 100awk-v"DATA=$DATA"-v"PATTERN=$PATTERN"'{printindex(DATA,PATTERN)}'# get index from $DATA to match $PATTERN, start from 1# $DATA and $PATTERN can pass from bash