2009/5/15 Chet Ramey <chet.ra...@case.edu>: > Lluís Batlle wrote: >> Hello, >> >> I have a problem in bash (3.2 and 4). I have it compiled with >> "-DSYS_BASHRC=/etc/bashrc", and since some time ago I could use "bash >> --rcfile ~/.myrc" to skip the parsing of /etc/bashrc. >> >> I can't recall what was the compile configuration of that bash where >> this worked. But in the latest bash 3.2 and 4 I've tried (for 4, I >> have all patches published), using "--rcfile" *parses* /etc/bashrc > > This is how bash is supposed to behave. Defining SYS_BASHRC makes bash > source that file just before it sources the bashrc file.
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). > >> 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? >> Moreover, about parameter parsing, in bash versions 3.2 and 4, trying >> to run "bash -i --rcfile xxx" results in bad parameter parsing, >> getting a complain about parameter "--". > > The manual does have something to say about that: > > Bash also interprets a number of multi-character > options. These options must appear on the command line > before the single-character options to be recognized. Right. Thank you. I hadn't seen that before.