We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f5af733 commit 5d2d1aeCopy full SHA for 5d2d1ae
1 file changed
tests/test_cmd_stdin.sh
@@ -35,11 +35,8 @@ strip_header_if() {
35
STRIP_HEADER="$2"
36
37
if ${STRIP_HEADER}; then
38
- # The following does not work on all platforms:
39
- # grep --text mdat "${FILE}"
40
- # awk -b -v RS='mdat' '{print length($0); exit}' "${FILE}"
41
- # Hence the hardcoded variable below.
42
- MDAT_OFFSET=1061
+ MDAT_OFFSET=$(GREP_OPTIONS="" LC_ALL=C \
+ grep -b -m 1 -o --text mdat "${FILE}" | cut -d: -f 1)
43
dd if="${FILE}" of="${FILE}.strip" bs=1 skip="${MDAT_OFFSET}"
44
mv "${FILE}.strip" "${FILE}"
45
fi
0 commit comments