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

Re: more dependencies on emulation



>If zsh were really emulating sh, arrays wouldn't work at all.  So it's a
>bit dubious to force ksh syntax only, given that it affects the indices
>as well as the syntax.

In sh, $foo[1] is equivalent to ${foo}[1].  Consequently "emulate sh"
will have to affect this part of the syntax.  The other aspects of
arrays don't need to be affected by sh emulation, true, but it seems
rather stupid to make this distinction.

>I don't have a ksh to try this, but ~{pfalstad,rc} works fine in Bash
>(that is, the ~ is expanded), even though ~$USER doesn't expand tilde.
>In zsh's ksh emulation mode with this patch applied,

This patch doesn't affect that aspect of behaviour -- "emulate ksh" and
"emulate zsh" will affect this expansion behaviour exactly as they did
before.  It only affects behaviour when the new option is individually
changed.

>                                                     ~$USER works, but
>~{pfalstad,rc} fails unless IGNORE_BRACES is also unset.  There doesn't
>seem to be any way to get the Bash behavior (maybe not important), but
>the manual should probably mention the IGNORE_BRACES requirement if it
>is going to use ~{...} in this example.

Maybe.  The documentation phrases things in terms of the SH_FILE_SUBST
option, which is independent of IGNORE_BRACES.  A note about
IGNORE_BRACES would certainly be reasonable, but it's not essential.

-zefram




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