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