Thread (2 messages) read the whole thread 2 messages, 2 authors, 2018-08-12
DORMANTno replies

[PATCH] arm: simplify syscallnr.sh a bit

From: viro@ZenIV.linux.org.uk (Al Viro)
Date: 2018-08-12 14:25:37

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 ;-)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help