Re: Find out EXACTLY what shell is being used
Originally Posted by
for.i.am.root
Or better yet is there a one liner to figure out the current shell interpretor?
The following will print the full path wrapped in quotes.
Code:
stat -c%N $(which `ps -o comm= $$`)|awk -F' ' '{print $NF}'
Note that the $(command) construct is not available in the original Bourne shell (sh) -- if it is not supported in your shell(s) then you will have to separate things out a bit more (backticks can't be nested).
Additionally, 'stat' appears to only perform one level of dereferencing of symbolic links.
"We visited sixty-six islands and landed eighty-one times, wading, swimming (to shore). Most of the people were friendly and delightful; only two arrows shot at us, and only one went near -- So much for savages!" - J.C. Patterson
Bookmarks