Bash: Identifying the current shell

Display the currently used shell as follows:

echo $SHELL

Or, you can also use:

echo $0

For example:

$ echo $SHELL
/bin/bash
$ echo $0
-bash

Source: Linux Shell Scripting Cookbook

Subscribe

Subscribe to our e-mail newsletter to receive updates.

, , , ,