The only trick, then, is to find the end of the script and, thus, the start of the payload. Consider this file, deliver.sh: #!/bin/bash WORKDIR=$( mktemp -d ) #find last line +1 SCRIPT_END=$( awk ...
If you’re in the former camp, you’re probably cursing your allegiance when you need to make your bash scripts more interactive. Gum can help. It’s a utility that can handle your script input ...