Gentoo Archives: gentoo-user

From: Nicolas Richard <theonewiththeevillook@×××××.fr>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: Where does sudo get the PATH ?
Date: Thu, 11 Oct 2012 14:27:48
Message-Id: 871uh56q6t.fsf@yahoo.fr
In Reply to: Re: [gentoo-user] Re: Where does sudo get the PATH ? by Joost Roeleveld
1 Joost Roeleveld <joost@××××××××.org> writes:
2 > On Wednesday, October 10, 2012 04:57:50 PM Nicolas Richard wrote:
3 >> In my homedir:
4 >> .bash_profile loads .bashrc
5 >> .bashrc says export PATH="~/bin/overrideglobal:${PATH}:~/bin" (and
6 >> defines some aliases)
7 >
8 > Does it load any global default?
9
10 No. Here are the full files, omitting comments and empty lines :
11
12 youngfrog@geodiff-mac3 ~ $ grep -vH '^#\|^$' .bashrc .bash_profile
13 .bashrc:export PATH="~/bin/overrideglobal:${PATH}:~/bin"
14 .bashrc:if [[ $- != *i* ]] ; then
15 .bashrc: # Shell is non-interactive. Be done now!
16 .bashrc: return
17 .bashrc:fi
18 .bashrc:UPDATEGITREPO="~/TeX/ ~/BSSM/2011/notes-de-conf/ ~/org/ ~/BSSM/2012"
19 .bashrc:export UPDATEGITREPO
20 .bashrc:alias ll="ls -lA"
21 .bashrc:alias l="ls -CF"
22 .bashrc:alias cp="cp -i"
23 .bashrc:alias rm="rm -i"
24 .bashrc:alias mv="mv -i"
25 .bash_profile:[[ -f ~/.bashrc ]] && . ~/.bashrc
26
27 > In other words, what is in the environment when you are normally
28 > logged in?
29
30 Ok, I thought my original post contained it. In fact that was part of my
31 original post :
32
33 youngfrog@geodiff-mac3 ~ $ bash -c 'echo $PATH'
34 ~/bin/overrideglobal:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.5.4:/usr/games/bin:/usr/local/texlive/2012/bin/i386-linux:~/bin
35
36 and I forgot to mention that it was the same as :
37 youngfrog@geodiff-mac3 ~ $ env | grep ^PATH
38 PATH=~/bin/overrideglobal:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.5.4:/usr/games/bin:/usr/local/texlive/2012/bin/i386-linux:~/bin
39
40 and yet the same as :
41 youngfrog@geodiff-mac3 ~ $ echo $PATH
42 ~/bin/overrideglobal:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.5.4:/usr/games/bin:/usr/local/texlive/2012/bin/i386-linux:~/bin
43
44 Thanks for trying btw. I certainly did something really stupid to set
45 the path the first time, but can't see where.
46
47 N.

Replies

Subject Author
Re: [gentoo-user] Re: Where does sudo get the PATH ? Pandu Poluan <pandu@××××××.info>