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

Re: Globbing in redirections



> This patch makes redirection behave a little more like ksh.
> It disables globbing on filenames in redirections, but only when
> multios are disabled.  (Globbed redirections are a very useful way
> to generate multios.)  Note that behaviour is still not exactly
> like ksh, as brace expansion is still done.  But ksh seems to treat
> brace expansion as part of globbing: compare "echo ~{root,nobody}"
> in the two shells.  (KSH_BRACES, anyone?)

No, that's a different problem.  In zsh filename expansion is performed
after most other substitutions while POSIX says that it must be the first
expansion which must be done before $ susbstitutions.  In zsh I can use

USER=hzoli ; echo ~$USER

but this does not work in a POSIX compilant shell.  I'll move filename
expansion before the other substitutions if zsh is invoked as sh/ksh.  Or
maybe an option should control this?  I personally think that the best
would be to do filename expansions first even if zsh is invoked as zsh but
I'm sure that it will break some scripts.  Does anyone have such a script?

Zoltan




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