2 replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/
source | link

Bash scripts start with the following line

#!/bin/bash
# Rest of script below
...

In bash the # character is the start of a comment, but #!/bin/bash is definitely not a comment, therefore it isn't bash but the kernelit isn't bash but the kernel that interprets that statement.

So what exactly is that first line? Is it a specific language, or a special one-off case in the Linux kernel? Are there other commands or statements in this "language" that can be used when scripting?

Bash scripts start with the following line

#!/bin/bash
# Rest of script below
...

In bash the # character is the start of a comment, but #!/bin/bash is definitely not a comment, therefore it isn't bash but the kernel that interprets that statement.

So what exactly is that first line? Is it a specific language, or a special one-off case in the Linux kernel? Are there other commands or statements in this "language" that can be used when scripting?

Bash scripts start with the following line

#!/bin/bash
# Rest of script below
...

In bash the # character is the start of a comment, but #!/bin/bash is definitely not a comment, therefore it isn't bash but the kernel that interprets that statement.

So what exactly is that first line? Is it a specific language, or a special one-off case in the Linux kernel? Are there other commands or statements in this "language" that can be used when scripting?

    Post Closed as "Duplicate of…" by slm, Gilles 'SO- stop being evil', jasonwryan, rahmu, Chris Down of
1
source | link

What is the language that appears on the first line of a script?

Bash scripts start with the following line

#!/bin/bash
# Rest of script below
...

In bash the # character is the start of a comment, but #!/bin/bash is definitely not a comment, therefore it isn't bash but the kernel that interprets that statement.

So what exactly is that first line? Is it a specific language, or a special one-off case in the Linux kernel? Are there other commands or statements in this "language" that can be used when scripting?