Computing.Net > Forums > Unix > how to find in which shell you are

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

how to find in which shell you are

Reply to Message Icon

Name: David Jeyam
Date: July 16, 2002 at 21:22:16 Pacific
Comment:

Can any one tell me how to find in which unix shell i am present using a shell script. I want it to find it programatically.

Thanks in advance..
David Jeyam



Sponsored Link
Ads by Google

Response Number 1
Name: David Jeyam
Date: July 17, 2002 at 03:15:16 Pacific
Reply:

If i type

$ export $SHELL

--this will give the current shell. But if i change the shell to ksh,
$ ksh

--this wont be reflected in the Shell variable (SHELL). So if this is the case how to know in which shell i am present !

regs


0

Response Number 2
Name: Howard Collier
Date: July 23, 2002 at 09:26:40 Pacific
Reply:

Issue the following command:

env | grep SHELL


0

Response Number 3
Name: niru
Date: July 24, 2002 at 07:31:43 Pacific
Reply:

The prompt will tell u.
but same prompt for ksh & sh.

In that case issue ps command .it will tell u.If u start another shell inside,then u have to grep and check with PPID..

hi Howard, ur command will give u the default shell, not the current shell.
Thanks,
niru


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Time monitored Input prom... Lost root password



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: how to find in which shell you are

How to find out the file by hour www.computing.net/answers/unix/how-to-find-out-the-file-by-hour/8129.html

How to find CPU usage, RAM, Hard Disk www.computing.net/answers/unix/how-to-find-cpu-usage-ram-hard-disk/3417.html

tired of 'pwd' www.computing.net/answers/unix/tired-of-pwd/4452.html