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

Re: export "a=b"=~



Stephane Chazelas wrote on Wed, Mar 08, 2017 at 08:50:00 +0000:
> Not that it's likely to ever be a concern, but I just noticed:
> 
> $ zsh -c 'export "a"=a=~; echo $a'
> a=~
> $ zsh -c 'export "a=a"=~; echo $a'
> a=/home/chazelas
> $ zsh -c 'export a=a=~; echo $a'
> a=~
> 
> (5.1.1)

[ I assume the point is that tilde expansion wasn't expected in the
second case. ]

Same behaviour in latest master.  This is because the MAGIC_EQUAL_SUBST
option, even when unset, implicitly applies to "export".  (The
declaration of "export" in builtins.c has the BINF_MAGICEQUALS flag
since before CVS.)

Should the behaviour be changed in 'emulate sh' / 'setopt posix*' mode?



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