History

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.

Michael Forney committed 7 years ago

Commit ebf8d821 parent 886532a1 file · +1 −1Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/atomic/check-atomics.sh+1−1
@@ -22,7 +22,7 @@ while read header; do · 21 unmodified lines
2222 OLDSUM="$(tail -n 1 ${LINUXDIR}/include/${header})"
2323 OLDSUM="${OLDSUM#// }"
2424
25− NEWSUM="$(head -n -1 ${LINUXDIR}/include/${header} | sha1sum)"
25+ NEWSUM="$(sed '$d' ${LINUXDIR}/include/${header} | sha1sum)"
2626 NEWSUM="${NEWSUM%% *}"
2727
2828 if [ "${OLDSUM}" != "${NEWSUM}" ]; then