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 '='. > > d...@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) > d...@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 > d...@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