1

Ensure shell script is launched with correct shell

view story
linux-howto

http://stackoverflow.com – Our shell script's first line reads #!/bin/bash According to my (limited) Linux shell knowledge this causes to use /bin/bash to launch the application when the user invokes this script directly, e.g., using $ ./myscript.sh Unfortunately, the script works not as expected, when the user launches it using $ sh ./myscript.sh How can I catch the case that the "wrong" shell executes this script and show the user an appropriate error message? (HowTos)