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.
Showing the changes to scripts (1 of 1 file). Show all
Unified · Split
| @@ -22,7 +22,7 @@ while read header; do · 21 unmodified lines | |||
| 22 | OLDSUM="$(tail -n 1 ${LINUXDIR}/include/${header})" | 22 | OLDSUM="$(tail -n 1 ${LINUXDIR}/include/${header})" |
| 23 | OLDSUM="${OLDSUM#// }" | 23 | OLDSUM="${OLDSUM#// }" |
| 24 | 24 | ||
| 25 | NEWSUM="$(head -n -1 ${LINUXDIR}/include/${header} | sha1sum)" | 25 | NEWSUM="$(sed '$d' ${LINUXDIR}/include/${header} | sha1sum)" |
| 26 | NEWSUM="${NEWSUM%% *}" | 26 | NEWSUM="${NEWSUM%% *}" |
| 27 | 27 | ||
| 28 | if [ "${OLDSUM}" != "${NEWSUM}" ]; then | 28 | if [ "${OLDSUM}" != "${NEWSUM}" ]; then |