when the caracters #! are the first two of a script, it is not a comment.   
It tells what executable should be used to interpret the commands of this   
file.
so any script beginning with #!/bin/bash will be executed under /bin/bash
but others scripts with #!/bin/awk will be executed under awk ...

SO WHY DOES IT WORK WITHOUT ??
because you are already running /bin/bash. When you execute a script that   
does not contain this 2 special caracters, the running shell is used ...

 -----Message d'origine-----
De: Kuruvilla Chandy [SMTP:[EMAIL PROTECTED]]
Date: dimanche 20 septembre 1998 13:17
�: linux-newbie
Objet: curious about bash scripts

<< Fichier: ATTACH01>>
Hi,

Why do a lot of bash scripts start with the first line as #!/bin/bash?

They seem to work just as well without.

Thanks,
Ishaaq Chandy

Reply via email to