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
Message-Id: tkrat.06e2765dbda0e9a3@igpm.rwth-aachen.de
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-1.4.2.17/bin:/opt/sun-jdk-1.4.2.17/jre/bin:/opt/sun-jdk-1.4.2.17/jre/javaws:/usr/kde/3.5/bin:/usr/qt/3/bin:/usr/games/bin) > 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-1.4.2.17/bin:/opt/sun-jdk-1.4.2.17/jre/bin:/opt/sun-jdk-1.4.2.17/jre/javaws:/usr/kde/3.5/bin:/usr/qt/3/bin:/usr/games/bin:/home/daid/scripts:/sbin:/home/daid/.gentoo/java-config-2/current-user-vm/bin:/usr/sbin:/usr/local/warlock2:/usr/local/sbin:/home/daid/physics/transport_for_crib/transport1.6/bin > 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