On Fri, 2010-11-26 at 11:27 -0500, Stephen Powell wrote:
> If a script wants to know which shell is running it, the
> variable $0 might work.  For example,
> 
>    echo $0 

I tried this... but see what I got:

j...@squeeje:~$ cat sh.sh 
#!/bin/sh
echo $0

j...@squeeje:~$ cat bash.bash 
#!/bin/bash
echo $0

j...@squeeje:~$ 
j...@squeeje:~$ ./sh.sh
./sh.sh
j...@squeeje:~$ 
j...@squeeje:~$ ./bash.bash 
./bash.bash
j...@squeeje:~$ 


seems that $0 simply contains the program being run and not the
interpreter that is running it...

?

Joao



-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/1290789632.6333.1.ca...@squeeje.critical.pt

Reply via email to