[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190618053306.730-1-mforney@mforney.org>
Date: Mon, 17 Jun 2019 22:33:06 -0700
From: Michael Forney <mforney@...rney.org>
To: Will Deacon <will.deacon@....com>,
Peter Zijlstra <peterz@...radead.org>
Cc: Boqun Feng <boqun.feng@...il.com>, linux-kernel@...r.kernel.org
Subject: [PATCH] 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 <mforney@...rney.org>
---
scripts/atomic/check-atomics.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/atomic/check-atomics.sh b/scripts/atomic/check-atomics.sh
index cfa0c2f71c84..8378c63a1e09 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
--
2.20.1
Powered by blists - more mailing lists