Created
April 12, 2018 20:21
-
-
Save nascheme/4d24e611364506183d66f7654ba3e9ac to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Embedded archive in shell script. | |
# To create script: | |
# cat <this script>.sh <archive file> > <script>.run | |
# chmod +x <script>.run | |
archive () { | |
# lines of script to skip (computed automatically) | |
skip=$(awk '/^__ARCHIVE_FOLLOWS__/ { print NR + 1; exit 0; }' $0) | |
tail -n +${skip} $0 | |
} | |
############################################################################## | |
# Insert your script here. 'archive' will produce the archive on stdout | |
archive | tar ztf - | |
############################################################################## | |
# Don't modify anything below this line. | |
############################################################################## | |
exit 0 | |
__ARCHIVE_FOLLOWS__ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment