[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

PS1 & PS2



  Hello.

  My prompt strings $PS1 and $PS2 work as expected for non-root users
but not for root.

  Here is my /etc/profile:

# cat /etc/profile
----------------------- quote -------------------------
# /etc/profile: system-wide .profile file for bash(1).
# $Id: profile,v 3.2 1995/01/21 12:32:53 imurdock Exp $

export PAGER='less -qCi'
export LESS='-qCi -P?f% .?ltLine %lt:?pt%pt\%:?btByte %bt:-...'
export EDITOR=/usr/bin/elvis
export VISUAL=pico

# define bash prompts
export PS1='\h:[*\u*]\w \$ '
export PS2='\h:[*\u*] And? \$ '

export PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:."

umask 022
---------------------- unquote -------------------------

  However, when I login as `root', I see this:

---------------------- quote ---------------------------
Debian GNU/Linux 0.93
Copyright (C) 1994, 1995 Debian Association, Inc. and others
bedlam login: root
Password:
Last login: Fri Nov  3 16:34:40 on tty1
Linux bedlam 1.2.13 #3 Thu Nov 2 22:17:57 PST 1995 i486
Copyright (C) 1994, 1995 Debian Association, Inc. and others

 ...

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY.
#
------------------------ unquote ------------------------------

  whereas, when I login as `gonzo', I see this:

------------------------ quote --------------------
Debian GNU/Linux 0.93
Copyright (C) 1994, 1995 Debian Association, Inc. and others
bedlam login: gonzo
Password:
Last login: Thu Nov  2 23:03:18 on tty3
Linux bedlam 1.2.13 #3 Thu Nov 2 22:17:57 PST 1995 i486
Copyright (C) 1994, 1995 Debian Association, Inc. and others

 ...

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY.
bedlam:[*gonzo*]~ $
-------------------------- unquote -----------------------------

  By contrast, the same definition of $PS1 and $PS2 in my old S'ware
/etc/profile gives me root and non-root prompts that differ only w/r
the `\$' character.

  Is this difference intentional on the part of Debian or what?

  Thank you!

   Bill

P.S. Is there any way to define something that works like `\$' in
the context of initializing $PS1 and $PS2 but which has the effect

      prompt_char <- ( if user == root then `$' else `:' )

say?


Reply to: