Linux – How to find out which Shell you are using?
Posted by walrus on July 21, 2008
Here are three quick ways to find out which shell you are currently using:
Method 1:
command:
# echo $SHELL
output:
/bin/bash
Method 2:
command:
# echo $0
output:
-bash
Method 3:
command:
# ps -p $$
output:
PID TTY TIME CMD
1447 tty1 00:00:01 bash

anshprat said
#! /bin/ksh
echo $SHELL
will still give me bash. How do I get the desired output in this case, i.e, ksh? I want to know the shell under which the process is running..