ash: eliminate 16 bytes in bss
[oweals/busybox.git] / applets / usage_compressed
index c30bcfa29b2a710a7e594eb23130f40b37b3dca0..8d343529d3074a0d40f513621b301c152061d805 100755 (executable)
@@ -7,6 +7,7 @@ test "$target" || exit 1
 test "$loc" || loc=.
 test -x "$loc/usage" || exit 1
 test "$SED" || SED=sed
+test "$DD" || DD=dd
 
 sz=`"$loc/usage" | wc -c` || exit 1
 
@@ -20,15 +21,15 @@ echo 'static const char packed_usage[] ALIGN1 = {'
 ##
 ## "$loc/usage" | bzip2 -1 | od -v -x \
 ## | $SED -e 's/^[^ ]*//' \
-## | $SED -e 's/ //g' \
-## | grep -v '^$' \
-## | $SED -e 's/\(..\)\(..\)/0x\2,0x\1,/g'
+##     -e 's/ //g' \
+##     -e '/^$/d' \
+##     -e 's/\(..\)\(..\)/0x\2,0x\1,/g'
 
-"$loc/usage" | bzip2 -1 | od -v -t x1 \
+"$loc/usage" | bzip2 -1 | $DD bs=2 skip=1 2>/dev/null | od -v -t x1 \
 | $SED -e 's/^[^ ]*//' \
-| $SED -e 's/ //g' \
-| grep -v '^$' \
-| $SED -e 's/\(..\)/0x\1,/g'
+       -e 's/ //g' \
+       -e '/^$/d' \
+       -e 's/\(..\)/0x\1,/g'
 
 echo '};'
 echo '#define SIZEOF_usage_messages' `expr 0 + $sz`