Sunday, March 18, 2012

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

 

On 18Mar2012 10:33, 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
|
| If understand Bash correctly /etc/profile should set aliases globally
| for all users, ROOT included (I'm on Debian Testing). 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..."

Yeah. Hideously inefficient isn't it? Gah!

| What am I doing wrong here?

1: How do you know what is being sourced? I suggest putting "echo"
statements in each file at the top for tracing this.

2: /etc/profile is only sourced by login shells.
Other interactive shells do not source it. And aliases are not
exported. Aliases belong in the .bashrc.

What files get sourced depend on your login environment.
A console login of course runs a login shell.

A GUI environment usually does _not_. However, because of this, many GUI
environments configure new terminals to invoke login shells.

Have a read of the "FILES" section, right at the bottom of "man bash".
It provides a very short overview of the files in play.

Then read the much wordier "INVOCATION" section.

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

John M Feiereisen (feiereis@border.ecn.purdue.edu) wrote:
: Fine. Now could you give us some pointers on farting in a
: one-piece rainsuit?
Wait 5 seconds, pull collar open, lower helmet so the vapors can flow in
freely, inhale deeply. Ahhh, next best thing to legalized drugs. YMMV
with other people's farts.
- Jonathan G. <jmg@uclink.berkeley.edu> "Know Fear"

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

__,_._,___

No comments:

Post a Comment