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 1 4 Weeks Ago 01:32 PM
Weird in Shell Prompt bobbygsk UNIX for Advanced & Expert Users 6 01-31-2008 11: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 11:10 AM
No shell prompt? Mufasa UNIX for Dummies Questions & Answers 2 02-14-2002 04:31 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 04-26-2005
Registered User
 

Join Date: Apr 2005
Posts: 2
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  
Old 04-26-2005
kduffin's Avatar
UN1X
 

Join Date: Nov 2003
Location: Virginia
Posts: 441
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  
Old 04-26-2005
Registered User
 

Join Date: Apr 2005
Posts: 2
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  
Old 04-27-2005
Just Ice's Avatar
Lights on, brain off.
 

Join Date: Mar 2005
Location: in front of my computer
Posts: 629
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 Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 10:11 AM.


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

Content Relevant URLs by vBSEO 3.2.0