Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!pasteur!ucbvax!decwrl!decvax!watmath!egisin From: egisin@watmath.waterloo.edu (Eric Gisin) Newsgroups: comp.unix.wizards Subject: Re: redirection before wildcards Message-ID: <19501@watmath.waterloo.edu> Date: 16 Jun 88 00:11:57 GMT References: <16101@brl-adm.ARPA> <670021@hpclscu.HP.COM> Organization: U of Waterloo, Ontario Lines: 13 In article <670021@hpclscu.HP.COM>, shankar@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.