Same machine, different versions of zsh?

Why would my login account for zsh show:
Initializing zsh version number 4.1.1

but if I sudo zsh I get:
Initializing zsh version number 4.2.5

(I have an admin account, but not root)

Much thanks,
Kyle

Dual 1 Ghz G4 (with tail-fins and push-button transmission), Mac OS X (10.4.8), My other Mac is ubuntu

Posted on Jan 8, 2007 6:46 PM

Reply
11 replies

Jan 8, 2007 8:35 PM in response to Kyle Skrinak

Hi Kyle,
You've made a great choice in shell; you've stumbled on a small but dedicated chapter of the zsh fan club. I assume that your system has two versions of zsh installed, although OS X only ships with one. The one in my /bin directory is version 4.2.3 so you may have more than one non-stock version of zsh. If you execute the following command, it will report all of the zsh executables in your path:

where zsh

You can then determine the version of each by executing "zsh --version" but with a full path to each of the executables. For instance, the following command will tell you the version of the one in /bin:

/bin/zsh --version

The reason root got a different version of zsh is that when you execute "sudo zsh", you get the first version in your path, whereas the one you get when you login is specified in your NetInfo or Open Directory account.
--
Gary
~~~~
Ummm, well, OK. The network's the network, the computer's
the computer. Sorry for the confusion.
-- Sun Microsystems

Jan 9, 2007 7:37 PM in response to Kyle Skrinak

<pre>
zsh-% fink describe zsh
Information about 5862 packages read in 1 seconds.

zsh-4.3.2-1003: The Z Shell
To make the Fink zsh your default user shell, do the following:</pre>
1. Add the line /sw/bin/zsh to the file /etc/shells
<pre>
2. Execute the following command: chsh -s /sw/bin/zsh
3. Open a new terminal session.
</pre>


G5 2x2.5 GHZ and a few others Mac OS X (10.4.8)

Jan 10, 2007 2:07 PM in response to Michael Conniff

<pre>
whence [ -vcwfpams ] name ...
For each name, indicate how it would be interpreted if used as a
command name.

-v Produce a more verbose report.

-c Print the results in a csh-like format. This takes
precedence over -v.

-w For each name, print `name: word' where word is one of
alias, builtin, command, function, hashed, reserved or
none, according as name corresponds to an alias, a
built-in command, an external command, a shell function,
a command defined with the hash builtin, a reserved word,
or is not recognised. This takes precedence over -v and
-c.

-f Causes the contents of a shell function to be displayed,
which would otherwise not happen unless the -c flag were
used.

-p Do a path search for name even if it is an alias,
reserved word, shell function or builtin.

-a Do a search for all occurrences of name throughout the
command path. Normally only the first occurrence is
printed.

-m The arguments are taken as patterns (should be quoted),
and the information is displayed for each command match-
ing one of these patterns.

-s If a pathname contains symlinks, print the symlink-free
pathname as well.

where [ -wpms ] name ...
Equivalent to whence -ca.

which [ -wpams ] name ...
Equivalent to whence -c.

</pre>

G5 2x2.5 GHZ and a few others Mac OS X (10.4.8)

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Same machine, different versions of zsh?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.