Skip to main content
2 of 2
edited tags; edited tags
Gilles 'SO- stop being evil'
  • 865.9k
  • 205
  • 1.8k
  • 2.3k

Does the shebang determine the shell which runs the script?

This may be a silly question, but I ask it still. If I have declared a shebang

#!/bin/bash 

in the beginning of my_shell_script.sh, so do I always have to invoke this script using bash

[my@comp]$bash my_shell_script.sh 

or can I use e.g.

[my@comp]$sh my_shell_script.sh 

and my script determines the running shell using the shebang? Is it the same happening with ksh shell? I'm using AIX.

jrara
  • 2.1k
  • 9
  • 23
  • 20