Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Feb 2003 23:49:31 +0200
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        David Banning <david@skytracker.ca>
Cc:        questions@FreeBSD.ORG
Subject:   Re: shell prompt question
Message-ID:  <20030216214931.GB2106@gothmog.gr>
In-Reply-To: <20030216152524.A14300@skytrackercanada.com>
References:  <20030216152524.A14300@skytrackercanada.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2003-02-16 15:25, David Banning <david@skytracker.ca> wrote:
> My normal prompt is;
>
> david $
>
> and my superuser prompt is;
>
> #

The way that the shell prompt is set depends on the particular shell.
What shell does your `david' user have?  What shell does `root' have?

> How do I get the super-user prompt when I just use the "su" command
> rather than the full "su -" command?

The default behavior of su is to run an interactive, but not login,
shell AFAIK.  How to set the prompt for interactive invocations of
your root user's shell depends on the shell.

> I want to stay in the same directory I am in sometimes but have su
> authority. The problem is that my prompt doesn't change, so I forget
> that I am su.

Use `su -m' as below.  How to set the prompt to something that changes
when you switch from simple user to superuser and vice versa depends
on the shell you have.  Using bash here, I can see:

	$ echo "prompt = $PS1"
	prompt = \$
	$ su -m
	Password:
	#

- Giorgos



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030216214931.GB2106>