Tuesday, March 20, 2012

[LINUX_Newbies] Re: File /etc/profile ignored by Bash

 

On 20Mar2012 11:47, Pascal Bernhard <pascal.hasko@yahoo.de> wrote:
| I use a 'normal shell' and a 'root shell' at the same time, that's
| why I want to configure settings for root. By 'shell' I mean terminal
| emulators, a yellow background for the normal user, a blue one for root
| as a reminder as to when I might break things on the command line. I
| find this preferable to using 'sudo'.

Fine.

| Symlinking the .bashrc files under /root and the HOME-directory
| seems not such a good idea to me. So someone advised me to put aliases,
| functions, color settings and so on in /etc/profile. Thus they would be
| to all users.

Firstly, putting aliases into /etc/profile won't work. You need them in
non-login shells and they are not exported. So they need to be in a
bashrc.

Secondly, putting it into the global profile or bashrc is just rude.
Aside from very basic things like j=jobs and h=history, this kind of
clutter is just annoying to other users. Even on your own personal system,
you may one day share it with a visitor.

Just put it in /root/.bashrc, possible sourcing a common file.
For example, you could make a /etc/bashrc.local and source it in
/root/.bashrc perhaps.

Personally, I invoke su via a wrapper; it runs su and gets it to invoke
a shell with my own environment. (A plain, non-login su nearly does this
anyway.) Just be sure to use "su -" to get a real vanilla root shell
when doing installs or starting daemons; it ensures they don't get an
environment cluttered with possibly misbehaving stuff.

Cheers,
--
Cameron Simpson <cs@zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

Just because Unix is a multiuser system doesn't mean I want to share it with
anybody! - Paul Tomblin, in rec.aviation.military

__._,_.___
Recent Activity:
To unsubscribe from this list, please email LINUX_Newbies-unsubscribe@yahoogroups.com & you will be removed.
.

__,_._,___

No comments:

Post a Comment