Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site fortune.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!ihnp4!fortune!olson From: olson@fortune.UUCP Newsgroups: net.unix Subject: Re: An odd difference between 'cat file' - (nf) Message-ID: <3077@fortune.UUCP> Date: Tue, 17-Apr-84 15:09:35 EST Article-I.D.: fortune.3077 Posted: Tue Apr 17 15:09:35 1984 Date-Received: Wed, 18-Apr-84 08:11:19 EST Sender: notes@fortune.UUCP Organization: Fortune Systems, Redwood City, CA Lines: 25 #R:opus:-36700:fortune:26900046:000:1105 fortune!olson Apr 17 10:35:00 1984 > The reason that ``cat xyz*'' is expanded and ``cat is not has to do with the C getchar() call. cat takes any > arguments on the command line that don't start with a ``-'', > expands them, and interprets them as filenames. However, if > you use the ``<'' before the filename, the filename is actually > used as stdin and the filename is not put on the command line. > Therefore, cat thinks that you are typing in somthing from the > terminal. Hope this helps. > Curt Jeff Sampson > alberta!jeff This is totally mistaken, the expansion is done by the shell (in this case the Bourne shell). Only on non-unix systems that try to emulate Unix, (or have a different form of wild-card expansion), do the programs themselves do wild-card expansion. (There are, as always, exceptions even in programs that run under Unix.) I suspect, but have not verified, that the Bourne shell stops expanding wild cards after the >, <, and | chars (up to a terminal character, be it newline, &, or ;). (Those of you who have looked at the sh source know why I haven't verified it -:).) Dave Olson