Created
September 24, 2014 10:19
-
-
Save jorge-lavin/f5bb3cfe40241b53aa59 to your computer and use it in GitHub Desktop.
To know your current shell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In case you're using more than one shell at a time, say, bash, then ksh then bash .. and so forth | |
# you may wanna know which is the current shell active | |
# $$ contains the PID of the parent process (i.e., the spawned shell) | |
my_shell=`ps -p $$ | tail -1 | awk '{print $NF}'` | |
echo ${my_shell} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment