[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How can i specify the scripting language used for parsing a script?
From: |
Maarten Billemont |
Subject: |
Re: How can i specify the scripting language used for parsing a script? |
Date: |
Sat, 5 Feb 2011 14:21:07 +0100 |
On 05 Feb 2011, at 13:57, ali hagigat wrote:
>
> #!/bin/sh
> echo ppppppp
> echo $SHELL
> exit 2200
>
> In the above script i tried to specify /bin/sh as my parser by a
> comment. Is that OK? When I type ./scr2 , i want bash recognize
> /bin/sh as the parser of ./scr2.
>
The comment is called a hashbang or shebang. It tells the kernel which program
to start. Your script is passed over stdin to the interpreter.
Note that on many system /bin/sh is a symlink to bash, so interpreting your
code with /bin/sh would just start the bash interpreter in POSIXLY_CORRECT mode.