#!/bin/sh
#
# bashx - bash compressor. upx(1) but for bash scripts only

echo '#!/bin/sh' >"${1}"xz
echo '(sed -n 2q; exec unxz) <"$0" | bash -s -- "$@"; exit' >>"${1}"xz
xz -c -6 "$1" >>"${1}"xz
chmod +x "${1}"xz

# smaller?
# cp $0 /tmp/M;(sed 1d $0|xzcat)>$_;$_;exit
