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 and shell scripting languages 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-23-2008 03:19 AM
can someone help me with modifying this file eamani_sun Shell Programming and Scripting 2 05-22-2008 02:15 PM
modifying my shell nico-hellas Shell Programming and Scripting 1 08-05-2005 10:43 AM
modifying the writing of a log... Nicol Shell Programming and Scripting 2 04-13-2005 11:05 AM
Modifying Route hoang IP Networking 1 06-25-2002 08:55 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-01-2006
mahatma mahatma is offline
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
  #2 (permalink)  
Old 08-01-2006
Rohini Vijay Rohini Vijay is offline
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 .......
  #3 (permalink)  
Old 08-01-2006
mahatma mahatma is offline
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
  #4 (permalink)  
Old 08-01-2006
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
This has been asked (and answered) before.Here's the link.
  #5 (permalink)  
Old 08-01-2006
mahatma mahatma is offline
Registered User
  
 

Join Date: Mar 2006
Posts: 36
Hmm, I cannot see anything mentioned in that link wrt color!
  #6 (permalink)  
Old 08-02-2006
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
Here's a link to colours in the prompt. Enjoy.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:51 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0