redirection before wildcards

Rick Schubert rns at se-sd.sandiego.NCR.COM
Thu Jun 16 05:08:09 AEST 1988


In article <7979 at alice.UUCP> andrew at 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 at se-sd.sandiego.NCR.COM)



More information about the Comp.unix.wizards mailing list