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: Wed, 10 Oct 2012 14:59:13
Message-Id: 87pq4q74sx.fsf@yahoo.fr
In Reply to: Re: [gentoo-user] Re: Where does sudo get the PATH ? by "J. Roeleveld"
1 >>>>> "Joost" == J Roeleveld <joost@××××××××.org> writes:
2 Joost> And, what is in the .bash_profile and .bashrc files in your
3 Joost> homedir and in root's homedir?
4
5 In my homedir:
6 .bash_profile loads .bashrc
7 .bashrc says export PATH="~/bin/overrideglobal:${PATH}:~/bin" (and
8 defines some aliases)
9
10 In root's: I have no such files.
11
12 Maybe it would be less distracting if I don't use a shell at all :
13
14 youngfrog@geodiff-mac3 ~ $ sudo -i env | grep ^PATH
15 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.5.4:/usr/local/texlive/2012/bin/i386-linux:/root/bin
16
17 youngfrog@geodiff-mac3 ~ $ sudo env | grep ^PATH
18 PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin:/usr/local/texlive/2011/bin/i386-linux
19
20
21 Joost> What do you get with "echo $PATH" when not using sudo?
22
23 You mean, when I'm logged in as root ? Then it's the same as when using
24 sudo -i.
25
26 N.

Replies

Subject Author
Re: [gentoo-user] Re: Where does sudo get the PATH ? Joost Roeleveld <joost@××××××××.org>