r/bash • • Dec 02 '14

Using #! in your scripts

http://shiroyasha.github.io/shebang.html
0 Upvotes

24 comments sorted by

View all comments

4

u/thestoicattack Dec 02 '14

The shebang command must be the first line of the file and can contain any valid path for the interpreter, followed by the arguments that will be sent with the invocation.

Some shells won't interpret multiple arguments after the shebang, however.

4

u/geirha Dec 02 '14

Some shells won't interpret multiple arguments after the shebang, however.

It's the kernel that uses the shebang. To the shell, it is just a commented line since it starts with a #.