bashunixshellcshtcsh

How to determine the current interactive shell that I'm in (command-line)


How can I determine the current shell I am working on?

Would the output of the ps command alone be sufficient?

How can this be done in different flavors of Unix?


Solution

  • UPDATE: Someone brought up "ash" (Almquist Shell) in comments. There seem to be 2001 variants of it including dash; so in the interest of not blowing up the answer unnecessarily, here's a very useful page listing a ton of various flavours of ash and their differences from each other and often from stanard Bourne sh: https://www.in-ulm.de/~mascheck/various/ash/