I have a self-extracting bash script (binary data appended to the end) like this:
#!/bin/bash export TMPDIR=$(mktemp -d) ARCHIVE_START_LINE=$(...) # <omitted> # extracting data archive into a temporary directory tail -n+$ARCHIVE_START_LINE $0 | tar xzv -C $TMPDIR # <ACCESSING_ARCHIVED_RESOURCES> exit 0 # <BINARY_DATA_ARCHIVE> The script is hosted remotely at https://<omitted>/script.sh
I want to pull the script and execute it locally.
As I'm using tail within the script passing it current file name as an argument, I cannot do:
/bin/bash -c "$(curl -fsSL https://<omitted>/script.sh)" Of course I can first save it into a temporary file, e.g.:
TMP=$(mktemp); curl -fsSL https://<omitted>/script.sh > $TMP; sh $TMP; rm $TMP But... any neater way?
tail? Wouldn't that be a decent solution?sharfile? mankier.com/1/shar