*BSD News Article 59525


Return to BSD News archive

Newsgroups: comp.unix.bsd.freebsd.misc
Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.mira.net.au!yarrina.connect.com.au!news.uwa.edu.au!DIALix!melbourne.DIALix.oz.au!seeware!mark
From: mark@seeware.DIALix.oz.au (Mark Hannon)
Subject: Re: SU's or TCSH's behavior (bug?)
Organization: Private FreeBSD site
Message-ID: <DL3z2B.72F@seeware.DIALix.oz.au>
References: <4cu8fd$54l@news.bu.edu>
Date: Sat, 13 Jan 1996 07:20:34 GMT
Lines: 27

Mikhail Teterin (mi@aldan.algebra.com) wrote:
: $user is not set by `su'-command. Tcsh does not change a prompt to root
: (or whatever the new user is), `mail' attempts to read the original user's
: mailbox, while `elm' works as I'd expect...

Hi!

Don't know if it's a bug or not - if all you want to do is see if you are uid=0
then set $prompt as below.

putte:~/src> su
Password:
putte:~/src# echo $user
mark
putte:~/src# echo $prompt
%m:%~%#

Now you can see a # if you are root, doesn't really help with mail though - btw.
On my system su is aliased to su -m, but even \su'ing leaves $user set.

/mark

-- 
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
| Mark Hannon,| FreeBSD - Free Unix for your PC| mark@seeware.DIALix.oz.au|
| Melbourne,  | PGP key available by fingering | epamha@epa.ericsson.se   |
| Australia   | seeware@melbourne.DIALix.oz.au |                          |