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

MAGIC_EQUAL_SUBST



I'd like to change the behaviour of the shell option MAGIC_EQUAL_SUBST in
a way which I think will make it more comprehensible and so useful, but I'd
like to check no-one is relying on the old behaviour.

The option is supposed to make arguments looking like assignments get ~ and
= substitution, just like a real assignment would (the argument is still
otherwise a normal command argument, however).  The current behaviour is:

% unsetopt magicequalsubst
% print foo=~/a:~/b --foo=~/a
foo=~/a:~/b --foo=~/a:~/b
% setopt magicequalsubst
% print foo=~/a:~/b --foo=~/a
foo=/home/user2/pws/a:/home/user2/pws/b --foo=~/a

The special behaviour only happens when the first thing looks like a
variable name.  This was my idea and I think I got it wrong:  the shell
shouldn't second guess what an assignment for an external program looks
like.

So I'd like to alter it to make it more consistent --- this only affects
the behaviour with the option set, of course:

% print foo=~/a:~/b --foo=~/a
foo=/home/user2/pws/a:/home/user2/pws/b --foo=/home/user2/pws/a

This will make it useful in things like `./configure --prefix=~' which I
should probably have thought about originally.

Is anyone likely to be upset by such a change?

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy



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