On Sun, Aug 12, 2018 at 10:57:42PM +1000, Stephen Rothwell wrote:
+nr=$(sed -n -E \
+ 's/^([[:xdigit:]Xx]+)[[:space:]]+'"${my_abis}"'[[:space:]].*$/\1/p' "$in" |
+ sort -n | tail -n1)
+nr=$(($nr + 1))
Alternatively,
nr=$(awk -e "/^[[:xdigit:]Xx]+[[:space:]]+${my_abis}/ {if (\$1 > max) max = \$1} \
END {print max + 1}" "$in")
Matter of taste, of course - if that is ever get fed something so large that
use of sort + tail to find the maximum would be noticable, we are in a very
deep trouble for other reasons ;-)