An odd difference between 'cat file' - (nf)

olson at fortune.UUCP olson at fortune.UUCP
Thu Apr 19 06:09:30 AEST 1984


#R:opus:-36700:fortune:26900048:000:1047
fortune!olson    Apr 18 10:17:00 1984

>>  I frankly don't know why there is a difference between cat ab* and cat <ab*.
>>  It seems to me that file name expansion should be done before anything else.
>  
>  So tell me, what would you expect to see if ab* matched two or more files?
>  			Tom Gloger
>  			ihnp4!ltuxa!tty3b!tag

The same as what the csh or sh does if you give it explicit
names!  The other files are passed as arguments to the command;
(e.g. cat > a b), neither csh or sh care where the '> file' occurs in
the command line.

Unfortunately this is NOT what happens.  If you have files
a1 and a2, and type cat > a*, sh will (SILENTLY!) create a file
called a* (as complained about in the original note), while csh
complains 'a*: Ambiguous' (even if nonomatch is set).

The basic complaint is that sh does NOT expand wild cards after
>, <, <<, and >> (and their variants), while csh does.  How ambiguity
or lack of matches are handled is something else altogether!
	Dave Olson, Fortune Systems
	UUCP: {ihnp4,ucbvax!amd70}!fortune!olson
	ARPA: amd70!fortune!olson at BERKELEY



More information about the Comp.unix mailing list