On Thu, Jul 29, 2004 at 01:29:30PM -0000, Dan wrote:
> Where and how do you set the prompt to show what user name that  your  on IE ROOT or 
> user johndoe.
> Eample of what the end results I would like to see.
> # router1.pdx/chatusa.com user johndoe.

Depends on what shell you're using.  Assuming that you meant to type
'router1.pdx.chatusa.com' as the fully qualified hostname, then for

    set prompt="# %M user %n "

For bash(1):

    PS1="# \H user \u "

For zsh(1):

    prompt="# %M user %n "

For sh(1), which doesn't have any sort of escape character support for
its prompts, you'ld have to do something like:

    PS1="# $(hostname) user $(id -un)"

which just uses the regular string substition features supplied by the
shell. [The difference is immaterial here, but if you wanted, say, to
display the current working directory in your shell prompt, the
%-escape or \-escape style would do it without any fuss.  The sh(1)
style means you'ld have to arrange to reset the prompt each time you
changed directory.]



Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

Attachment: pgpDXIIB40Zpu.pgp
Description: PGP signature

Reply via email to