#!/bin/sh mkdwarfs -i "$@" -o "$(basename "$@").sh" --header <(cat << 'EOF' #!/bin/sh DIR=/tmp/.dwarf_$(basename "$0")$RANDOM mkdir "$DIR" 2> /dev/null dwarfs -o offset=auto "$0" "$DIR" 2> /dev/null "$DIR/AppRun" $@ fusermount -uz "$DIR" 2> /dev/null rmdir "$DIR" 2> /dev/null exit EOF ) chmod +x "$(basename "$@").sh"