Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Jan 2000 06:07:29 +0100 (CET)
From:      Oliver Fromme <olli@dorifer.heim3.tu-clausthal.de>
To:        freebsd-questions@FreeBSD.ORG
Subject:   Re: window manager question
Message-ID:  <200001060507.GAA59854@dorifer.heim3.tu-clausthal.de>
In-Reply-To: <850om7$24jg$1@atlantis.rz.tu-clausthal.de>

next in thread | previous in thread | raw e-mail | index | archive | help
Jonathon McKitrick <jcm@dogma.freebsd-uk.eu.org> wrote in list.freebsd-questions:
 > On Wed, 5 Jan 2000, Oliver Fromme wrote:
 >>When you use ``su -m'', the environment variables are not
 >>modified (see the su(1) manpage), including $USER, $LOGNAME,
 >>$HOME, $MAIL...  I guess this has confused your mail client.
 > 
 > Here's one problem i have with this: i have several aliases for root only
 > to mount filesystems and do a few other things.  Is there a way to pick
 > these up when i su to root?

There is certainly a way:  You have to define the aliases in
the right rc file or profile.  This depends on your login shell
(unfortunately you didn't mention which shell you're using).

For example, the zsh uses the following rc/profiles:

   ~/.zshenv    read by EVERY zsh
   ~/.zprofile  read by LOGIN shell only
   ~/.zshrc     read by INTERACTIVE shell only
   /.zlogin     read by LOGIN shell only

So if you want to be really sure, put your aliases, functions,
variables, whatever into ~/.zshenv, which will be read by every
invocation of zsh.  However, aliases are only useful for
interactive shells, so it is better to put them into ~/.zshrc
to avoid unnecessary overhead.  Putting them in ~/.zprofile or
~/.zlogin wouldn't work with ``su -m'', because it doesn't run
a login shell.

All of that can be different with different shells.  You should
read the section about startup files in the manpage of your
shell.

Regards
   Oliver

-- 
Oliver Fromme, Leibnizstr. 18/61, 38678 Clausthal, Germany
(Info: finger userinfo:olli@dorifer.heim3.tu-clausthal.de)

"In jedem Stück Kohle wartet ein Diamant auf seine Geburt"
                                         (Terry Pratchett)


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?200001060507.GAA59854>