Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: pushd



> Oh, what was the reasoning behind requiring "(UID=123; foo)" where
> "UID=123 foo" used to work?  I liked the exporting syntax.

It was the simplest way to handle special parameters.  If you say
parameter=value command the given environment variable is always set to
value even if it is a special parameter or integer or anything.  So now
UID=hzoli printenv UID says hzoli.  In case of UID it may net be the
desired behaviour but in some other cases this makes things simpler.  I
also liked the exporting syntax but I often tried to use that to a zsh
function or to a builtin which caused irreversibly lost privileges.
Offtopic but note that USERNAME is much more secure as it now executes
initgroups() as well similarily to su username (this is new, zsh-3.0.0 does
not do that).

A somewhat related question:

% ksh
$ readonly foo=foo    
$ foo=bar printenv foo
ksh: foo: is read only

% zsh
% readonly foo=foo    
% foo=bar printenv foo
bar

The current bash version behaves similarily but I talked to the bash
maintainer and he thinks that the ksh behaviour is the correct one and
bash-2.0 will now allow this.  Similar question:

% ksh
$ typeset -i i=12
$ i=foo printenv i
0

Zsh prints foo here.  That's why UID=798 command does not work.

Zoltan



Messages sorted by: Reverse Date, Date, Thread, Author