redirection before wildcards

Eric Gisin egisin at watmath.waterloo.edu
Thu Jun 16 10:11:57 AEST 1988


In article <670021 at hpclscu.HP.COM>, shankar at hpclscu.HP.COM (Shankar Unni) writes:
> But, for curiosity's sake, why exactly are redirections performed *before*
> wildcard expansions?  For "historical" ( :-> ) reasons only? Or is there a
> grander design behind it?

It is probably due to the way redirection is implemented.
If you use one algorithm for redirection, whether it be applied to
executable commands, built-ins, or control statements, then
you perform redirection before you have determined the type of command.
Argument and assignment expansion occurs after you have determined
you have a simple-command.

I haven't checked whether this is true for the SysV shell,
but it is the way I implemented things.



More information about the Comp.unix.wizards mailing list