Command to findout the current shell?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Command to findout the current shell?
# 1  
Old 09-07-2005
Command to findout the current shell?

Hi,

Can you please tell me if there is anyway we can findout which shell we are using (is there any command?)

Many thanks,
# 2  
Old 09-07-2005
from the command line you can try: echo $0
# 3  
Old 09-07-2005
That's great. Thanks you so much for your speedy response
# 4  
Old 09-07-2005
Many environments have the environment variable SHELL -
Code:
echo $SHELL

as well.
# 5  
Old 09-07-2005
Quote:
Originally Posted by jim mcnamara
Many environments have the environment variable SHELL -
Code:
echo $SHELL

as well.
Code:
$ echo $SHELL         
/usr/local/bin/bash
$ tcsh
$ echo $SHELL
/usr/local/bin/bash

but...
Code:
$ echo $0
bash
$ tcsh
$ echo $0
tcsh

# 6  
Old 09-07-2005
Yes. it shows the login shell, which I should have mentioned.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

How to reduce and findout CPU usage?

Frequently i am getting "total CPU is now 100.00%, which is above the error threshold (90%)" this error . (3 Replies)
Discussion started by: ranjithm
3 Replies

2. Shell Programming and Scripting

Findout path

hi Friends,pls help me , 1.I have one directory,in that directory i have one path like /user/bin/perl like this. 2.how to find out that path and how to know the that path is existed or not in that directory. 3.can u people give me one shellscript for this scenario. Regards vasu (1 Reply)
Discussion started by: vas
1 Replies

3. Linux

Findout iLO type installed in a machine

I have to write Linux script to findout what kind of ilo is been installed in the given ip address either ilo/LO100 or no device found. IP address will be given in the command line of the script. -> With out log on to the ip address, should get the ilo type installed in that machine. 1. I... (1 Reply)
Discussion started by: skmdu
1 Replies

4. UNIX for Advanced & Expert Users

how to findout the file system type?

Hi all, How to findout the file sytem type which is NFS and which is Local? Suppose i have 5 different folders my in Root directory. dir 4 and 5 are mounted on different file system and dir 1,2 and 3 are mounted on different fild system Now i wanted know which file sytem is Local and which... (1 Reply)
Discussion started by: psiva_arul
1 Replies

5. UNIX for Dummies Questions & Answers

How do I know my current shell

when I get from my shell into other shell, what is the best way to identify the current new shell in a script ? for example: logged on with bash, and typed csh. I got out the following option: ps -ef | awk -v PID=$$ '{ if ( $2 == PID ) { gsub ("-","") ; print $NF}}' any other idea ? (3 Replies)
Discussion started by: ynixon
3 Replies

6. Shell Programming and Scripting

How to run a new shell with copy of current shell declarations?

How to run another shell and have all current shell dectaration copied to that new shell? I would like to have available all current declarations in a new shell. That are functions, aliases, variables. I need to test some functions that use the 'exit', but running it in current shell on... (9 Replies)
Discussion started by: alex_5161
9 Replies

7. HP-UX

GCC version findout

Hi, In unix box GCC installed under the /usr/local/bin/gcc, i want to know the version of GCC. Could you please let me know the process for that. Thanks & Regards, Suji (1 Reply)
Discussion started by: srujana
1 Replies

8. UNIX for Dummies Questions & Answers

How to findout the creation date?

Hi all Is ther anyway I can findout the date on which a file was created??? Regards Sube (3 Replies)
Discussion started by: sube
3 Replies

9. UNIX for Dummies Questions & Answers

Findout Idle Time Setting

Hi Guru's, How do I find and set the login idle time setting in HP-UX 32? Thanks in advance, Mani (1 Reply)
Discussion started by: jvmani
1 Replies

10. UNIX for Dummies Questions & Answers

How do you know what your current shell is?

How do you know what shell you're in? I'm not looking for my login shell, but the one that i'm in currently. Example: bash-2.03$ csh aries% ksh $ What indicates that i'm in the c shell or the korn shell? (4 Replies)
Discussion started by: shad0w75
4 Replies
Login or Register to Ask a Question