The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Exit Shell Prompt after Pbrun ishanc Shell Programming and Scripting 0 04-28-2008 03:32 PM
Weird in Shell Prompt bobbygsk UNIX for Advanced & Expert Users 6 01-31-2008 10:13 AM
script to change shell and prompt SHYAM Shell Programming and Scripting 1 06-27-2004 05:46 AM
prompt in sh shell diegoe UNIX for Dummies Questions & Answers 1 12-30-2003 10:10 AM
No shell prompt? Mufasa UNIX for Dummies Questions & Answers 2 02-14-2002 03:31 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-26-2005
Registered User
 

Join Date: Apr 2005
Posts: 2
Stumble this Post!
shell specific prompt

currently, I set my prompt in my .cshrc file as:
set prompt = "%B%h %m %P %/ \n% "

I have to use certain shells for some specific tasks and would like to set different prompts depending on the type of shell that I am using. Any advice?

Thanks
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 04-26-2005
kduffin's Avatar
UN1X
 

Join Date: Nov 2003
Location: Virginia
Posts: 441
Stumble this Post!
Just have a if/then/else or case statement on the $SHELL variable. Then you can set your PS1 value accordingly.

Cheers,

Keith
Reply With Quote
  #3 (permalink)  
Old 04-26-2005
Registered User
 

Join Date: Apr 2005
Posts: 2
Stumble this Post!
When I launch a new shell from the command line, the value of my $SHELL variable does not change so I am not able to do an if statement on it.
Reply With Quote
  #4 (permalink)  
Old 04-27-2005
Just Ice's Avatar
Lights on, brain off.
 

Join Date: Mar 2005
Location: in front of my computer
Posts: 629
Stumble this Post!
the only way i know to set this up is to set the prompt for each shell using the specific shell's initialization files --- .login & .cshrc for csh, .profile and .kshrc for ksh, .bashrc for bash, etc. ...
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 03:49 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0