In the header of a script a declaration of what shell will be used is inserted. So if you were using Bash as the shell you would insert this line in the header of the script:
This line should be the first line and it calls the command interpreter.
What happens if you create a second line with “#!/bin/bash”, will that create a new shell?
When you receive a new shell, the variables that you have set in memory on the first shell do not carry forward. So to test double entries of “#!/bin/bash” create a variable in the first shell and see it if carries over after tryinng ot invoke a new shell with “#!/bin/bash”. Try this script to check.
echo "This is the start of a bash shell script"
echo "Wondering if this starts a new shell?"
echo "The answer is NO, since the variable $myvar remains the same."
The second “#!/bin/bash” is simply interpreted as a comment.