[Nix-dev] bash (no -l) resetting PATH?

Lluís Batlle i Rossell viriketo at gmail.com
Tue Feb 8 08:27:31 CET 2011


On Tue, Feb 08, 2011 at 06:40:44AM +0100, Marc Weber wrote:
> Try this:
> 
> PATH=/fooX:$PATH
> bash
> echo $PATH
> 
> /fooX will not appear in $PATH because /etc/bashrc unsets it.
> Debian installations don't do it.
> So what's the reason for this behaviour?
> 
> I know I could set NOSYSBASHRC..
> It looks to me that all the stuff in /etc/bashrc setting env vars should
> go into /etc/profile which is sourced on login only ?
Then, daemons without the proper PATH would fail to run system commands when
using system() or alike, I imagine.

I think bashrc should have the role of providing some default paths, the same
way as "/bin" is hardcoded as PATHs where to look for files.

Maybe bashrc could simply *append* to PATH?



More information about the nix-dev mailing list