I'm looking for a way to have an executable binary hardwired into a script. Something like this:
#!/bin/bash ...some shell code execute binary: >>> binary code ... <<< ...some more shell code possibly
I've found this solution, which uses
uuencode and is good. But it depends on
shrutils, which seem to be an extra, as they're not included by default on my Debian.
I've been thinking of having the binary encoded with
base64 and then decoding it and somehow executing, possibly without creating any temp files. I remember there was a library that's responsible for executing things, but forgot what it was.
It might be the best to have a construct as simple as this execute:
$ <(base64 out | base64 -d) bash: /dev/fd/63: Permission denied