Files
oam/knowledge base/get the current shell.md
2024-02-17 14:25:53 +01:00

775 B

Get the current shell

  1. TL;DR
  2. Further readings
    1. Sources

TL;DR

# Full path of the current shell's executable with arguments.
ps -o 'command='

# Full path of the current shell's executable only.
ps -o 'comm='

# Only the executable name.
ps -co 'comm='

# Unreliable: if the SHELL variable is set by a previous shell, that one is the
# value that will be shown.
echo "$SHELL"
echo "$0"

Further readings

Sources