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.

Reply via email to