The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Modifying a variable value kartikkumar84@g UNIX for Dummies Questions & Answers 6 05-22-2008 11:19 PM
can someone help me with modifying this file eamani_sun Shell Programming and Scripting 2 05-22-2008 10:15 AM
modifying my shell nico-hellas Shell Programming and Scripting 1 08-05-2005 06:43 AM
modifying the writing of a log... Nicol Shell Programming and Scripting 2 04-13-2005 07:05 AM
Modifying Route hoang IP Networking 1 06-25-2002 04:55 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 07-31-2006
Registered User
 

Join Date: Mar 2006
Posts: 36
Need help in modifying the prompt

Hi,

I want to change the login prompt from $ to something more explanatory like

(Username)(basename of pwd):

I also need to get this in a different font color.

Can someone pls tell me what I have to modify in my rc file. I m using CShell currently.

Would be great if u can give me the generic logic and how to do it in diff shells like Csh, TCsh, Ksh, Bash,sh shells.

Thanks
Reply With Quote
Forum Sponsor
  #2  
Old 08-01-2006
Registered User
 

Join Date: Apr 2006
Posts: 16
This command would set the default directory to the current dir.

Place this command in your . profile file.

export PS1=`uname -n`'@$PWD > '

I am not sure of how the text colour can be changed .......
Reply With Quote
  #3  
Old 08-01-2006
Registered User
 

Join Date: Mar 2006
Posts: 36
Thanks for the reply.

Would u know what to do for CSH also.

I tried set prompt='${LOGNAME}:${CWD}'

But when I change the directory, the working directory displayed in the prompt does not change.

Also the color. I m very particular abt that
Reply With Quote
  #4  
Old 08-01-2006
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,326
This has been asked (and answered) before.Here's the link.
Reply With Quote
  #5  
Old 08-01-2006
Registered User
 

Join Date: Mar 2006
Posts: 36
Hmm, I cannot see anything mentioned in that link wrt color!
Reply With Quote
  #6  
Old 08-01-2006
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,326
Here's a link to colours in the prompt. Enjoy.
Reply With Quote
  #7  
Old 08-01-2006
Registered User
 

Join Date: Mar 2006
Posts: 36
Wow! That was a good site. Thanks.
Would u know some sites for CSh (colors) also. Hope u r not already irritated!
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 11:24 PM.


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