help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Maintaining PATH while running make with sudo


From: John Calcote
Subject: Re: Maintaining PATH while running make with sudo
Date: Mon, 01 Mar 2010 14:07:12 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.8) Gecko/20100216 Thunderbird/3.0.2

Hi Steve,

I this what you're talking about:

$ sudo -s
root's password:
# echo $PATH
/usr/sbin:/bin:/usr/bin:/sbin
# make
/usr/sbin:/bin:/usr/bin:/sbin
#
# cat Makefile
all:
        @echo $(PATH)
#
# make --version
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for x86_64-unknown-linux-gnu

Seems to work for me on my 64-bit opensuse 11.2 box.

John

On 3/1/2010 1:52 PM, Steve Deiters wrote:
It seems make is setting a default PATH variable when I run with sudo.
If I run a root shell with 'sudo -s' followed by 'echo $PATH', I see the
correct PATH.  However, while in the root shell if I run the simple
Makefile:


----Makefile----

all:
        @echo $(PATH)

----------------

it will not give me the same as the result from the echo.


I am running Make 3.81, sudo 1.6.9p10, on Ubuntu 2.6.24-25-server
kernel.

Thanks.



_______________________________________________
Help-make mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/help-make






reply via email to

[Prev in Thread] Current Thread [Next in Thread]