Skip to main content
Question Protected by dr_
Tweeted twitter.com/#!/StackUnix/status/372104946499350528
edited tags; edited tags
Link
Gilles 'SO- stop being evil'
  • 865.9k
  • 205
  • 1.8k
  • 2.3k
Source Link
jrara
  • 2.1k
  • 9
  • 23
  • 20

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.