[OT] Is it "#!/bin/bash", "#! /bin/bash", or does it even matter?

Jonas Norlander jonorland at gmail.com
Sun Oct 25 09:20:17 UTC 2009


2009/10/25 Joe(theWordy)Philbrook <jtwdyp at ttlc.net>:
> Memory can be a silly thing.
> I know that if I want a script to be run by a particular shell (such as bash)
> then I want the first line of the script to start with "#!" followed by the
> path to the shell involved. But it suddenly occurred to me that I may have
> been doing it wrong.
>
> I'm not sure if it's supposed to look like:
> #!/bin/bash
> or like:
> #! /bin/bash
> And for that matter how about:
> #!  /bin/bash
> Which I'm likely to get because to be honest I can never remember if it's
> /bin/bash or /usr/bin/bash etc...

According to wikipedia[1] it can be any number of white spaces between
exclamation point and a absolute path to the interpreter program.

[1] http://en.wikipedia.org/wiki/Shebang_%28Unix%29

/ Jonas




More information about the kubuntu-users mailing list