How can you recognize a shell (C / Korn / Bourne) just by looking at the prompt?

Questions by sreedevichandran   answers by sreedevichandran

Showing Answers 1 - 2 of 2 Answers

Gopi K

  • Jun 21st, 2007
 

C shell - @
Bourne - %
Ksh - $

  Was this answer useful?  Yes

Pruthvi

  • Jul 13th, 2007
 

Hi



If we type any not existed command then the shell tell you that the command is not existed along with the shell name

Ex:
$ hello
then it says
bash:command not found
means that you are working with bash shell

  Was this answer useful?  Yes

Rakesh

  • Aug 8th, 2007
 

echo $SHELL will give you the shell name as well as the path.

  Was this answer useful?  Yes

$echo $SHELL
/bin/ksh
$
$csh
% echo $SHELL
/bin/ksh
% hello
hello: Command not found.
%

-->> The variable $SHELL doesn't show the shell when I changed the shel from ksh to csh
-->> Even trying to execute a non shell command (like hello) didn't tell the name of the shell as you can see here above. 

  Was this answer useful?  Yes

jana05

  • Jan 15th, 2008
 

I dont think so just by looking at the prompt one can recognize the shell [inputs pls, if otherwise], however you can run small commands to get the shell that you are using
    ps -p $$

should be your answer.

Ajit

  • Sep 11th, 2015
 

To know the shell type the command - $echo $SHELL

  Was this answer useful?  Yes

shailesh chanderiya

  • Jul 20th, 2016
 

For check current working shell is echo $0

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions