From: Michael Forney Date: Tue, 18 Jun 2019 05:33:06 +0000 (-0700) Subject: locking/atomics: Use sed(1) instead of non-standard head(1) option X-Git-Tag: v5.3-rc1~203^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ebf8d82bbb32720878a3867b28e655950ccee992;p=thirdparty%2Fkernel%2Flinux.git locking/atomics: Use sed(1) instead of non-standard head(1) option POSIX says the -n option must be a positive decimal integer. Not all implementations of head(1) support negative numbers meaning offset from the end of the file. Instead, the sed expression '$d' has the same effect of removing the last line of the file. Signed-off-by: Michael Forney Signed-off-by: Peter Zijlstra (Intel) Acked-by: Will Deacon Cc: Boqun Feng Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: https://lkml.kernel.org/r/20190618053306.730-1-mforney@mforney.org Signed-off-by: Ingo Molnar --- diff --git a/scripts/atomic/check-atomics.sh b/scripts/atomic/check-atomics.sh index cfa0c2f71c846..8378c63a1e09f 100755 --- a/scripts/atomic/check-atomics.sh +++ b/scripts/atomic/check-atomics.sh @@ -22,7 +22,7 @@ while read header; do OLDSUM="$(tail -n 1 ${LINUXDIR}/include/${header})" OLDSUM="${OLDSUM#// }" - NEWSUM="$(head -n -1 ${LINUXDIR}/include/${header} | sha1sum)" + NEWSUM="$(sed '$d' ${LINUXDIR}/include/${header} | sha1sum)" NEWSUM="${NEWSUM%% *}" if [ "${OLDSUM}" != "${NEWSUM}" ]; then