Re: how to determine the interpreter

2010-11-28 Thread Javier Barroso
Anand, sorry for the private .. On Sun, Nov 28, 2010 at 8:56 AM, Anand Sivaram aspn...@gmail.com wrote: Install realpath package. Then try realpath /proc/$$/pid Or without installing that package: readlink -f /proc/$$/pid -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org

Re: how to determine the interpreter

2010-11-27 Thread Anand Sivaram
On Fri, Nov 26, 2010 at 23:11, Stephen Powell zlinux...@wowway.com wrote: On Fri, 26 Nov 2010 11:40:32 -0500 (EST), Joao Ferreira wrote: seems that $0 simply contains the program being run and not the interpreter that is running it... Hmm. You're right. echo $0 works at a shell

how to determine the interpreter

2010-11-26 Thread Joao Ferreira gmail
hello all, considering sh, bash and csh, can I somehow, inside a script, determine if I'm being run with any of these 3 shells... I need to determine wich interpreter is running me... thx Joao -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of

Re: how to determine the interpreter

2010-11-26 Thread Camaleón
On Fri, 26 Nov 2010 15:11:07 +, Joao Ferreira gmail wrote: considering sh, bash and csh, can I somehow, inside a script, determine if I'm being run with any of these 3 shells... I need to determine wich interpreter is running me... A quick Google tour says: s...@stt008:~$ ps $$ PID

Re: how to determine the interpreter

2010-11-26 Thread Anand Sivaram
On Fri, Nov 26, 2010 at 21:01, Camaleón noela...@gmail.com wrote: On Fri, 26 Nov 2010 15:11:07 +, Joao Ferreira gmail wrote: considering sh, bash and csh, can I somehow, inside a script, determine if I'm being run with any of these 3 shells... I need to determine wich interpreter is

Re: how to determine the interpreter

2010-11-26 Thread Stephen Powell
On Fri, 26 Nov 2010 10:11:07 -0500 (EST), Joao Ferreira wrote: considering sh, bash and csh, can I somehow, inside a script, determine if I'm being run with any of these 3 shells... I need to determine wich interpreter is running me... The login shell is set in /etc/passwd on a

Re: how to determine the interpreter

2010-11-26 Thread Joao Ferreira gmail
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

Re: how to determine the interpreter

2010-11-26 Thread Burton Samograd
If you want to know if you're running in bash, you can test for the variable BASH_VERSION. if [ ! -z $BASH_VERSION ]; then echo I am running in bash exit fi echo I am running in sh -- Burton Samograd -- To

Re: how to determine the interpreter

2010-11-26 Thread Stephen Powell
On Fri, 26 Nov 2010 11:40:32 -0500 (EST), Joao Ferreira wrote: seems that $0 simply contains the program being run and not the interpreter that is running it... Hmm. You're right. echo $0 works at a shell prompt, but not within a script. I tried it within a script, sort of, by sourcing