Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prompt 1

Status
Not open for further replies.

Mowatt

IS-IT--Management
Jul 22, 2003
16
0
0
GB
How can I make all the user prompt's display the the server name and the user name's.

thanx mowatt [3eyes]
 
Put this in /etc/profile:

HOST=`/usr/bin/uname-n`
LOGNAME=`/usr/bin/logname`
export HOST LOGNAME
PS1='$LOGNAME@$HOST: $PWD >'
export PS1

The first two lines use the backtick quote. The fourth line uses the regular quotes.

Also, I added : $PWD to this so you will know which directory you are in.
 
Oop. The first line should be:

HOST=`/usr/bin/uname -n`

 
Or if you you use tcsh:

you can use something like:

Code:
set prompt="%S(%h)%s[%B%n%b@%M] [%~] %B%#%b "

It will give you something like this:

Code:
(158)[user@host] [/tmp] >

And it also properly changes the > to a # when you become super user.

--
Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top