Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!nosc!ucsd!ucsdhub!hp-sdd!hplabs!hpda!hpcuhb!hpcllla!hpclisp!hpclscu!shankar From: shankar@hpclscu.HP.COM (Shankar Unni) Newsgroups: comp.unix.wizards Subject: Re: redirection before wildcards Message-ID: <670021@hpclscu.HP.COM> Date: 10 Jun 88 01:01:16 GMT References: <16101@brl-adm.ARPA> Organization: HP NSG/ISD Computer Language Lab Lines: 12 > It's pretty well known that commands like "grep whatever * > out" can > cause infinate loops, because C-shell will create the file "out" > before expanding the asterisk wildcard, and grep never reaches EOF > once it reaches the file "out". > > Try `grep whatever * > .out'. Small consolation if you didn't :-) 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? -- Shankar.