I think sort is a great answer if for some reason you don't need awk logic to do this in a larger script, or you want to avoid extra pipes, or the goal of this question is to learn more about awk.
$ awk 'NR==1{x=$3;line=$0} $3<x{line=$0} END{print line}' snd
Broken into pieces, this is:
NR==1 {x=$3;line=$0} - In the first line, set the initial value for comparison and save the line.$3<x{line=$0} - In each line, compare the third field with our stored value, and if the condition is true, save the line. (We could only run this run on NR>1 , but that doesn't matter.END{print line} - At the end of our input, type any line that we saved.
You should read man awk to find out about any parts of this that don't make sense.
source share