My values โโof the second column start from 0 to 2000, and the variable $ a is set to 13. If the instruction in awk does not work as intended ... it prints all the values. The code:
#!/bin/sh
IFS=- read a b <<< "$1"
echo $a
echo $b
sort -r -k 2,2 $2 | awk '{if ($2 > $a) print $2}'
Everything is fine when I compare my second column like this (putting 13 instead of $ a):
sort -r -k 2,2 $2 | awk '{if ($2 > 13) print $2}'
So my thought is that I put the wrong argument $ a in
source
share