Check Shell Type Currently Use and Check Shell Version on Linux Fedora
How to check current Shell type that you are in or currently use on Linux Fedora... and how to check the Shell version on Linux Fedora... The article below show the step by step to check the current Shell that you use and how display the shell version on Linux Fedora 9.
The command example below can be use to display the current Shell that you are in.
[root@fedora ~]# echo $SHELL
/bin/bash
[root@fedora ~]#
The command example below is use to display Shell version that is currently use, base on command above.
[root@fedora ~]# /bin/bash --version
GNU bash, version 3.2.33(1)-release (i386-redhat-linux-gnu)
Copyright (C) 2007 Free Software Foundation, Inc.
[root@fedora ~]#
Keywords: check shell, check shell type, check shell version
- 35039 reads
- Email this page
2 comments
Shows only default shell
Submitted by Ray Foulkes (not verified) on Sat, 04/14/2012 - 08:08.Be careful, as far as I can determine the echo $SHELL does not tell you the actual shell in use, it only tells you the default shell. For example, if you put that command in a script which is invoked on a different shell, you will not see the ACTUAL shell used by the script.
Place hashpling/bin/tcsh at the beginning of a script with echo $SHELL in it and run the script from bash. It will report /bin/bash not /bin/tcsh.
Correct - Shows Only the $SHELL Environment Variable
Submitted by Aaron Newton (not verified) on Sat, 07/28/2012 - 12:55.Ray is correct - this only shows the $SHELL environment variable. You can check using the following commands ($ is terminal cursor):
$set | grep SHELL
SHELL=/bin/bash
$ ksh -c 'echo $SHELL'
/bin/bash
What you could try instead is the '$0' variable:
$ ksh -c 'echo $0'
ksh
aaron@zebrafish:~/oblivion/words$ echo $0
bash
'$0' is the name of the running process. See http://www.tldp.org/LDP/abs/html/othertypesv.html