Compiling a bash/shell script to binary

Start with your bash script

#!/bin/bashecho "How are you $1?"

Building the compiled script

To build the files we can run

shc -f scriptname.sh
mv scriptname.sh.x scriptname

Testing the compiled version

The last thing we have left to do is to make sure that everything went well in the process. We start by making the compiled file executable with chmod a+x scriptname . Next we test its output — In our case running:

./scriptname Medium 

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store