Skip to main content
1 of 5
Caleb
  • 71.9k
  • 19
  • 203
  • 232

There is almost always an environment variable $SHELL that you can learn this from. There are some edge cases where this will fail, particularly if one interactive shell is used to launch another.

Alternatively, most interactive shells will know what they are and give you some useful output to if you run something like echo $0.

Caleb
  • 71.9k
  • 19
  • 203
  • 232