Gentoo Archives: gentoo-user

From: Helmut Jarausch <jarausch@××××××××××××××××.de>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] zsh and sudo
Date: Fri, 19 Feb 2010 13:07:40
In Reply to: [gentoo-user] zsh and sudo by daid kahl
On 19 Feb, daid kahl wrote:
> Hello, > > I just installed zsh recently and was working on making the switch > over from bash for my daily user, provided I can get a few things > worked out. > > The biggest problem that I can't find useful results googling is zsh > interaction with sudo. > > I'm noticing some strange behavior with the PATH and also the > interpretation of '='. > > daid@flux log % sudo which useradd > which: no useradd in > (/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.4.3:/opt/sun-jdk- > daid@flux log % sudo echo $PATH > /usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.4.3:/opt/sun-jdk- > daid@flux log % which useradd > /usr/sbin/useradd > > So sudo has the PATH set correctly, but it doesn't actually use the > correct path. Fishy!
SNIP AFAIK, sudo invokes the shell specified in the environment. What is echo $SHELL saying? Here, is says /bin/zsh and your examples works just fine. Helmut. -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany