Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ucbvax!ucsd!ucsdhub!hp-sdd!ncr-sd!se-sd!rns From: rns@se-sd.sandiego.NCR.COM (Rick Schubert) Newsgroups: comp.unix.wizards Subject: Re: redirection before wildcards Message-ID: <1544@se-sd.sandiego.NCR.COM> Date: 15 Jun 88 19:08:09 GMT References: <16101@brl-adm.ARPA> <670021@hpclscu.HP.COM> <10066@tekecs.TEK.COM> <7979@alice.UUCP> Reply-To: rns@se-sd.sandiego.NCR.COM (Rick Schubert) Organization: NCR Corp. Systems Engineering, San Diego Lines: 22 In article <7979@alice.UUCP> andrew@alice.UUCP writes: > > >it is not that wildcards are expanded after redirection; >rather it is that bourne screwed the grammar. the grammar fo rthe shell >(such that it is) says essentially: > redir word >rather than > redir list >and then check that list generates just one thing. (wildcard expansion ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^!!!^^^^^^ >is only done for lists.) Maybe (notice that I qualified this -- I do not know for a fact) this is the key. Although wildcards are sometimes used for filename completion (I assume this means "use the name of the FILE that matches this pattern"), wildcards in general mean "use the NAMES of ALL the FILES that match this pattern". Since there can only be one filename per redirection, MAYBE Steve Bourne (or John Mashey before him, if the Mashey shell exhibited this behavior) reasoned that conceptually wildcard expansion didn't make sense (even though it could sometimes work if the expansion matched exactly one filename) for redirection and INTENTIONALLY wrote the grammar this way. -- Rick Schubert (rns@se-sd.sandiego.NCR.COM)