Skip to content

Instantly share code, notes, and snippets.

@jorge-lavin
Created September 24, 2014 10:19
Show Gist options
  • Save jorge-lavin/f5bb3cfe40241b53aa59 to your computer and use it in GitHub Desktop.
Save jorge-lavin/f5bb3cfe40241b53aa59 to your computer and use it in GitHub Desktop.
To know your current shell
# 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