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

Re: Globbing in redirections



>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?

I don't actually have a script that does this, but it's very nice
behaviour, and I do use it from time to time.  I think we should have
another option for this, which would have options
OPT_EMULATE|OPT_BOURNE.  Note that zsh actually follows csh behaviour,
so this really should be OPT_BOURNE and not OPT_NONZSH.  (If you've
never heard of these options, you'll need to check the patch in article
1275.)

However, my original point stands.  ksh doesn't do brace expansion in
redirections.  We need to split up prefork() somewhere -- is there
another function that would be more appropriate to use in this case?
We need all expansions except for brace expansion and globbing, but
prefork() does everything except globbing.

-zefram




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