I have this command
$ cut -f2,3 AIS2F1 | grep [2-9][0-9]* | cut -f1
So my second and third fields are something like this
Ben 434
Me 12
you 56
So, I thought that the logic should be to cut the second and third field then grep numbers that are bigger than 20 and then cut the first field. That should give me the name that is on the same line with number that is bigger than 20, but it gives me this output:
Ben
Me
you
instead of
Ben
you
which is what I want, how can I fix this command?
awk
is better suited here as well:awk '$3 ~ /[2-9][0-9]+/ { print $2 }' AIS2F1
+
or*
here. Also, looks likeawk '$3 >= 20 {print $2}
may be even more appropriate here.