GeekInterview.com
Series: Subject: Topic:
Question: 14 of 45

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

Asked by: sreedevichandran | Member Since Jun-2007 | Asked on: Jun 7th, 2007

View all questions by sreedevichandran   View all answers by sreedevichandran

Showing Answers 1 - 7 of 7 Answers
Gopi K

Answered On : Jun 21st, 2007

C shell - @
Bourne - %
Ksh - $

  
Login to rate this answer.

Hi gopi
Thanks for your response
I know the answer which u have mentioned here but we can also change the command prompt using the chsh command ,at this point, again this becomes a question?

  
Login to rate this answer.
Pruthvi

Answered On : 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

  
Login to rate this answer.
Rakesh

Answered On : Aug 8th, 2007

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

  
Login to rate this answer.
nareshbhatm

Answered On : Jan 6th, 2008

View all answers by nareshbhatm

$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. 

  
Login to rate this answer.
jana05

Answered On : Jan 15th, 2008

View all answers by jana05

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.

  
Login to rate this answer.
abdas

Answered On : Aug 1st, 2011

View all answers by abdas

There is no such way just by looking at the prompt as this is changable.

  
Login to rate this answer.

Give your answer:

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

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Ads

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.