You may have been in a situation where you want to embed a binary file in your shell script before sharing it with others. For example, you are working on an installation script that includes a tarball. Or you are writing a portable shell script that includes any external dependency. Find out find out how you can include a binary file in a bash script and how to retrieve it from the script.
Source: LXer – How to embed a binary file in a bash shell script