Lluís Batlle wrote:
> 
> I think I noticed SYS_BASHRC isn't sourced under "--rcfile" if bash
> 3.2 is not compiled with readline.
> I had scripts using this feature, and suddenly they started to fail
> when I used another bash (compiled with readline or ncurses).

I can't reproduce this.  A bash compiled without readline and SYS_BASHRC
defined behaves the same as a version compiled with readline included and
SYS_BASHRC defined.

>>> According to the manual, "--rcfile" should make bash avoid the system 
>>> bashrc.
>> I'm not sure which manual you mean.  The bash manual doesn't say anything
>> about SYS_BASHRC, since it's a feature that's not compiled in by default.
> 
> I agree. How do you suggest I can load an initialization file
> automatically (as with "--rcfile"), but without SYS_BASHRC being
> loaded?

The answer differs with the invocation circumstances, since the bash
behavior with loading startup files depends on how it is invoked.

If you want to keep bash compiled with SYS_BASHRC defined, and you
control the contents of SYS_BASHRC, you might want to change it so
it will not continue if a particular environment variable is defined:

if [ -n "$NOSYSBASHRC" ];then
        return
fi
[rest of /etc/bashrc goes here]

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRU    c...@case.edu    http://cnswww.cns.cwru.edu/~chet/


Reply via email to