GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  Operating System  >  Unix Programming
Go To First  |  Previous Question  |  Next Question 
 Unix Programming  |  Question 32 of 38    Print  
How can you recognize a shell (C / Korn / Bourne) just by looking at the prompt?

  
Total Answers and Comments: 6 Last Update: January 15, 2008     Asked by: sreedevichandran 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
June 21, 2007 08:59:29   #1  
Gopi K        

RE: How can you recognize a shell (C / Korn / Bourne) ...
C shell - @
Bourne - %
Ksh - $

 
Is this answer useful? Yes | No
June 22, 2007 10:00:06   #2  
sreedevichandran Member Since: June 2007   Contribution: 2    

RE: How can you recognize a shell (C / Korn / Bourne) ...
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?

 
Is this answer useful? Yes | No
July 13, 2007 00:05:01   #3  
Pruthvi        

RE: How can you recognize a shell (C / Korn / Bourne) ...
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

 
Is this answer useful? Yes | No
August 08, 2007 03:21:01   #4  
Rakesh        

RE: How can you recognize a shell (C / Korn / Bourne) ...
echo $SHELL will give you the shell name as well as the path.
 
Is this answer useful? Yes | No
January 06, 2008 05:23:51   #5  
nareshbhatm Member Since: January 2008   Contribution: 2    

RE: How can you recognize a shell (C / Korn / Bourne) just by looking at the prompt?
$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. 

 
Is this answer useful? Yes | No
January 15, 2008 01:49:06   #6  
jana05 Member Since: January 2008   Contribution: 26    

RE: How can you recognize a shell (C / Korn / Bourne) just by looking at the prompt?
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.

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape