hush/scripts/usage_compressed
Bernhard Reutner-Fischer 7fca7e3378 - use the SED given by the user
- use the portable `` instead of $(). There is no bbsh, so this is needed.
2006-05-26 13:28:39 +00:00

14 lines
332 B
Bash

#!/bin/sh
loc="$1"
test "$loc" || loc=.
test -x "$loc/usage" || exit 1
echo 'static const char packed_usage[] = '
"$loc"/usage | bzip2 -9 | od -v -t x1 \
| $SED -e 's/^[^ ]*//' -e 's/ \(..\)/\\x\1/g' -e 's/^\(.*\)$/"\1"/' || exit 1
echo ';'
sz=`"$loc"/usage | wc -c` || exit 1
echo '#define SIZEOF_usage_messages' `expr 0 + $sz`