Gentoo Archives: gentoo-user

From: Joost Roeleveld <joost@××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: Where does sudo get the PATH ?
Date: Wed, 10 Oct 2012 18:45:32
Message-Id: 2605336.yuE8B9dzFI@eve
In Reply to: [gentoo-user] Re: Where does sudo get the PATH ? by Nicolas Richard
1 On Wednesday, October 10, 2012 04:57:50 PM Nicolas Richard wrote:
2 > >>>>> "Joost" == J Roeleveld <joost@××××××××.org> writes:
3 > Joost> And, what is in the .bash_profile and .bashrc files in your
4 > Joost> homedir and in root's homedir?
5 >
6 > In my homedir:
7 > .bash_profile loads .bashrc
8 > .bashrc says export PATH="~/bin/overrideglobal:${PATH}:~/bin" (and
9 > defines some aliases)
10
11 Does it load any global default?
12
13 > In root's: I have no such files.
14 >
15 > Maybe it would be less distracting if I don't use a shell at all :
16 >
17 > youngfrog@geodiff-mac3 ~ $ sudo -i env | grep ^PATH
18 > PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/
19 > usr/i686-pc-linux-gnu/gcc-bin/4.5.4:/usr/local/texlive/2012/bin/i386-linux:/
20 > root/bin
21 >
22 > youngfrog@geodiff-mac3 ~ $ sudo env | grep ^PATH
23 > PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin:/
24 > usr/local/texlive/2011/bin/i386-linux
25 >
26 >
27 > Joost> What do you get with "echo $PATH" when not using sudo?
28 >
29 > You mean, when I'm logged in as root ? Then it's the same as when using
30 > sudo -i.
31
32 No, when you're logged in as your normal user.
33
34 In other words, what is in the environment when you are normally logged in?
35
36 --
37 Joost

Replies

Subject Author
[gentoo-user] Re: Where does sudo get the PATH ? Nicolas Richard <theonewiththeevillook@×××××.fr>