On Wednesday 03 March 2004 19:02, Colin Watson wrote:
> On Wed, Mar 03, 2004 at 08:56:49PM +0100, Ruben Porras wrote:
> > so, echo $SHELL seems not to be reliable, how could I now which
> > shell I am using? (Imagine you need to know in a script)?
>
> You should never need to know this in a script, because (correct)
> scripts should always have #! lines at the top specifying the
> interpreter to use.
>
> In practice I've never found myself needing a shell variable to let
> me know in any other situation either; I know what my login shell
> is, and I can use 'getent passwd | grep ^whatever-my-user-name-is'
> to find out if I don't.
>
> Cheers,

man getent says you can supply it with a key for the system 
database.  so it should work with just

getent passwd whatever-my-user-name-is


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to