You must make note of two things in this recipe:
- Change the working directory of the process to the location of the shell script.
- Use /bin/bash to execute the shell script.
If you don't do step 1, then you'll have to use the absolute path for the shell script file. However, in the recipe, we did do step 1, and hence, we just use the shell script name for the /bin/bash command.
Step 2 is basically how you would want to execute the shell script. The way to do so is to pass the shell script to the interpreter, which will interpret and execute the script. That is what the following line of code does: