Mailinglist Archive: opensuse (2835 mails)

< Previous Next >
Re: [opensuse] Which Shell do I Have?
  • From: Thomas Hertweck <Thomas.Hertweck@xxxxxx>
  • Date: Tue, 05 Dec 2006 20:15:01 +0000
  • Message-id: <4575D345.8050002@xxxxxx>

Patrick Shanahan wrote:
> * Kai Ponte <kai@xxxxxxxxxxxxxxxx> [12-05-06 08:12]:
> ...
>> In the instructions, it tells me to make some environment variable
>> changes. However, it has one set for a Borne Shell and another set
>> for a C shell.
>>
>> Which do I have?
>
> echo $SHELL

Hmmm... I would like to point out that this will (most likely) only
print the default shell which is set in /etc/passwd (which should be
fine in Kai's situation). If the current shell needs to be determined,
it's better to use "echo $0". Example:

bash$> echo "$SHELL + $shell + $0"
/bin/bash + + /bin/bash
bash$> ash
ash$> echo "$SHELL + $shell + $0"
/bin/bash + + ash
ash$> ksh
ksh$> echo "$SHELL + $shell + $0"
/bin/bash + + ksh
ksh$> tcsh
tcsh$> echo "$SHELL + $shell + $0"
/bin/bash + /bin/tcsh + tcsh

Cheers, Th.
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups