From owner-freebsd-questions Fri Nov 16 14:11:44 2001 Delivered-To: freebsd-questions@freebsd.org Received: from atkielski.com (atkielski.com [161.58.232.69]) by hub.freebsd.org (Postfix) with ESMTP id 71CAA37B417 for ; Fri, 16 Nov 2001 14:11:41 -0800 (PST) Received: from contactdish (ASt-Lambert-101-2-1-14.abo.wanadoo.fr [193.251.59.14]) by atkielski.com (8.11.6) id fAGMBZI62712; Fri, 16 Nov 2001 23:11:35 +0100 (CET) Message-ID: <00c601c16eeb$a8607c30$0a00000a@atkielski.com> From: "Anthony Atkielski" To: "Mike Meyer" , References: <15349.30413.867238.510518@guru.mired.org> Subject: Re: Is root's search path special? Date: Fri, 16 Nov 2001 23:11:29 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Myprogram was an example, but the real-world case where I found this was with the text editor joe, which is an executable file. It's in /usr/local/bin, and /usr/local/bin is in my path, even under root, and yet the shell can't seem to find it when I am logged in as root, but it finds it when I'm logged in as a normal user. All the environment variables look pretty much the same, so I was thinking that there must be something weird about root, but I didn't know where to look to find out for sure. ----- Original Message ----- From: "Mike Meyer" To: "Anthony Atkielski" Cc: Sent: Friday, November 16, 2001 21:27 Subject: Re: Is root's search path special? > Anthony Atkielski types: > > Why is it that when I try > > > > % myprogram > > > > it will run under an ordinary user login, but cannot be found under a root > > login? The program myprogram is in /usr/local/bin, and /usr/local/bin appears > > in the PATH for both the user and the root login. Why doesn't it work under > > root? Is there something special about the way root executes things? > > Is myprogram by any chance a script? There's a bug - I claim it's in > the kernel, but the committers claim that it's in csh - that causes a > bad interpreter on the "#!" line in a script to cause the program to > be reported as "not found" by csh. > > If it is a script, you might verify that the #! line refers to the > interpreter by the full path. > > -- > Mike Meyer http://www.mired.org/home/mwm/ > Q: How do you make the gods laugh? A: Tell them your plans. > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message