[root@]# cat a
a 10%
b 25.5%
c 91%
d 50%
[root@]# cat a | awk '$2 >= 90%; END {print $_}'
awk: $2 > 90%; END {print $_}
awk: ^ syntax error
awk: each rule must have a pattern or an action part
Thanks, but your output is wrong, the output just "c".
posix is correct.
---------- Post updated at 02:54 AM ---------- Previous update was at 02:50 AM ----------
Thanks, i have another question:
how do i combine "awk 'int($2) > 90 ' a", with "sub {/c/, d}", and "sub {/ /, /\t/}"
means from the output of "c 90%", to "d 90%".
The ouput is not wrong, not just the one you were expecting. "c" is the only value with which column 2 is > 90%. I though you wanted to display only the first column as you didn't tell anything about the expected result and there was a print statement in your code.
Indeed although int() is unecessary, awk is already doing this by default.