PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > comp.unix.shell > how to find which shell I am using currently
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.unix.shell Using and programming the Unix shell.

how to find which shell I am using currently

Réponse
 
LinkBack Outils de la discussion
Vieux 30/10/2006, 16h46   #1
senthilS
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut how to find which shell I am using currently

I wanted to know if I can find the shell which I am using currently,
below is the method I tried out

$
$bash
bash-2.05$
bash-2.05$ echo $SHELL
/usr/bin/sh

bash-2.05$finger -m username

Login name: username In real life: Full Name
Directory: /home/username Shell: /bin/csh
On since Oct 25 16:28:23 on pts/2 from user.domain.com
3 minutes 52 seconds Idle Time

you can see that I changed my shell to bash but both the commands show
different shell environments?

What if I need to find which shell I am into now?
Thanks,

  Réponse avec citation
Vieux 30/10/2006, 17h07   #2
Loki Harfagr
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: how to find which shell I am using currently

Le Mon, 30 Oct 2006 08:46:43 -0800, senthilS a écrit:

> I wanted to know if I can find the shell which I am using currently,
> below is the method I tried out
>
> $
> $bash
> bash-2.05$
> bash-2.05$ echo $SHELL
> /usr/bin/sh
>
> bash-2.05$finger -m username
>
> Login name: username In real life: Full Name
> Directory: /home/username Shell: /bin/csh
> On since Oct 25 16:28:23 on pts/2 from user.domain.com
> 3 minutes 52 seconds Idle Time
>
> you can see that I changed my shell to bash but both the commands show
> different shell environments?
>
> What if I need to find which shell I am into now?



Try :
# echo $0
  Réponse avec citation
Vieux 30/10/2006, 17h54   #3
Robert Katz
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: how to find which shell I am using currently

senthilS wrote:
> I wanted to know if I can find the shell which I am using currently,
> below is the method I tried out
>
> $
> $bash
> bash-2.05$
> bash-2.05$ echo $SHELL
> /usr/bin/sh
>
> bash-2.05$finger -m username
>
> Login name: username In real life: Full Name
> Directory: /home/username Shell: /bin/csh
> On since Oct 25 16:28:23 on pts/2 from user.domain.com
> 3 minutes 52 seconds Idle Time
>
> you can see that I changed my shell to bash but both the commands show
> different shell environments?
>
> What if I need to find which shell I am into now?
> Thanks,
>


ps -p "$$" -o comm=


--
Regards,

---Robert
  Réponse avec citation
Vieux 30/10/2006, 23h02   #4
bsh
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: how to find which shell I am using currently

senthilS wrote:
> ...


Both "$0" and "ps" can be easily spoofed, and well as
needing to cater to portability concerns. In addition,
many shells will "advertise" themselves as another
shell ("bash" and "ksh" as "sh", etcetera) ostensibly
for configuring feature visibility yet obscuring the
controlling standard (SYS5, BSD, POSIX, ...).

For a non-trivial solution (listed in order of general
scope), see if any of the following fit your specific needs:

"shtype"
http://shelldorado.com/scripts/cmds/shtype.txt

"The Kameleon Shell.sh"
http://www.unixreview.com/documents/s=1344/ur0312e/

"whichshell"
http://groups.google.com/group/comp....513a857080ed64

"which_interpreter"
http://stchaz.free.fr/

=Brian

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 09h07.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,12421 seconds with 12 queries