1 |
On 19 Feb, daid kahl wrote: |
2 |
> Hello, |
3 |
> |
4 |
> I just installed zsh recently and was working on making the switch |
5 |
> over from bash for my daily user, provided I can get a few things |
6 |
> worked out. |
7 |
> |
8 |
> The biggest problem that I can't find useful results googling is zsh |
9 |
> interaction with sudo. |
10 |
> |
11 |
> I'm noticing some strange behavior with the PATH and also the |
12 |
> interpretation of '='. |
13 |
> |
14 |
> daid@flux log % sudo which useradd |
15 |
> which: no useradd in |
16 |
> (/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) |
17 |
> daid@flux log % sudo echo $PATH |
18 |
> /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 |
19 |
> daid@flux log % which useradd |
20 |
> /usr/sbin/useradd |
21 |
> |
22 |
> So sudo has the PATH set correctly, but it doesn't actually use the |
23 |
> correct path. Fishy! |
24 |
SNIP |
25 |
|
26 |
AFAIK, sudo invokes the shell specified in the environment. |
27 |
|
28 |
What is echo $SHELL saying? |
29 |
|
30 |
Here, is says /bin/zsh |
31 |
and your examples works just fine. |
32 |
|
33 |
Helmut. |
34 |
|
35 |
-- |
36 |
Helmut Jarausch |
37 |
|
38 |
Lehrstuhl fuer Numerische Mathematik |
39 |
RWTH - Aachen University |
40 |
D 52056 Aachen, Germany |