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
Changing Prompt in sh jcc5169 UNIX for Dummies Questions & Answers 1 11-17-2006 07:07 AM
Changing prompt kjbaumann SUN Solaris 2 06-29-2006 10:05 AM
Changing the prompt vibhor_agarwali UNIX for Dummies Questions & Answers 7 08-29-2005 05:06 AM
changing login prompt on redhat juilan UNIX for Dummies Questions & Answers 6 07-25-2003 07:14 AM
Changing the UNIX command prompt WERUreo UNIX for Dummies Questions & Answers 2 04-22-2002 08:45 PM

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

Join Date: Jan 2005
Posts: 28
Stumble this Post!
Changing Unix Prompt

Me again,

What is the difficulty to display the full directory Path before my prompt command ? (like DOS)

I'm using Solaris 8 + Bash

Thanks again

Fabien
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 01-07-2005
Registered User
 

Join Date: Aug 2004
Location: standing in a Sun 25k, Vienna
Posts: 78
Stumble this Post!
Just edit your PS1 Variable like

PS1=' `pwd` `uname -n` # '

Note the different characters ..

I´ve tried it on Solaris 9 SPARC and bash 2.05

To set this permanently :

Just edit the line at the end of your profile
($HOME/.profile)

after the Line you have to add "export PS1" like

...
PS1=' `pwd` `uname -n` # '
export PS1
...
Reply With Quote
  #3 (permalink)  
Old 01-07-2005
google's Avatar
Moderator
 

Join Date: Jul 2002
Location: Atlanta
Posts: 740
Stumble this Post!
You can also use the format: Am using Korn Shell on HP-UX 11.x

export PS1='$PWD--> '
Reply With Quote
  #4 (permalink)  
Old 01-07-2005
bhargav's Avatar
Registered User
 

Join Date: Sep 2004
Location: USA
Posts: 511
Stumble this Post!
Quote:
PS1=' `pwd` `uname -n` # '
Above may not work if u put 'pwd'

Try this ....

export PS1=[`hostname`]'$PWD:> '
Reply With Quote
  #5 (permalink)  
Old 01-07-2005
zazzybob's Avatar
Registered Geek
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
Stumble this Post!
Easiest way with bash:

export PS1='\w \$ '

bash has a load of prompt escape sequences - see this .

Cheers
ZB
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 09:12 PM.


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