Sunday, March 18, 2012

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

 

On Sun, Mar 18, 2012 at 5:33 AM, Pascal <pascal.hasko@yahoo.de> wrote:
>
>
>
> I have set up a couple aliases and functions for Bash in the following files /home/MYNAME/.bashrc ; /home/MYNAME/.bash_aliases as well as in /root/.bashrc and /etc/profile

Wow... why all over the place like that?

>
> If understand Bash correctly /etc/profile should set aliases globally for all users, ROOT included (I'm on Debian Testing).

How are you testing this? /etc/profile should be read if you log into
your machine via ssh, close down gdm, or switch to a different tty
(e.g., cntrl+Alt+F2 [Cntrl+Alt+F7/F6/F8 to get back to your X session
typically]) and log in. .bashrc is read if you start a terminal
emulator such as Xterm. Or at least that is how I understand it.
Also, you will have to log in and back out after making changes to
/etc/profile to see them take effect.

you can run from a Xterm emulator if you call bash from the cl with
'bash -l' or 'bash --login' to make it read etc/profile (see 'man
bash').

> Well, none of the configuration files mentioned above is sourced at startup, so I have to do it manually. In /etc/bash.bashrc Bash is told to source /etc/profile and /root/.bashrc if present via the 'default' if-statements:
> "if..... then do..."
>
> What am I doing wrong here?

The above suggested to me you were evaluating all of this from a
terminal emulator. Hence my suggestions and explanations in the
preceeding paragraph. Hopefully that was accurate and solves it for
you.

If not, feel free add some explanation or wait on someone else.

Cheers~

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

__,_._,___

No comments:

Post a Comment