Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-xxxfer.readnews.com!news-out.readnews.com!transit3.readnews.com!panix!not-for-mail From: JohnF Newsgroups: comp.lang.c Subject: Re: Command line arguments Date: Fri, 11 Jan 2013 06:54:56 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 18 Message-ID: References: <_1HHs.63$kp4.24@newsfe09.iad> <6AHHs.22803$fh5.11839@newsfe26.iad> NNTP-Posting-Host: panix3.panix.com X-Trace: reader1.panix.com 1357887296 21410 166.84.1.3 (11 Jan 2013 06:54:56 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Fri, 11 Jan 2013 06:54:56 +0000 (UTC) User-Agent: tin/2.0.0-20110823 ("Ardenistiel") (UNIX) (NetBSD/5.1.2 (i386)) Xref: csiph.com comp.lang.c:29934 BruceS wrote: > <> From a terminal (in Linux), type 'echo *', and it > echos a list of the files in that directory. Enclose in quotes (as > suggested elsethread), and type 'echo "*"', and get a single asterix. No longer a C question, per se, but bash's behavior (at least on my slackware 14.0 box) is a bit more complicated than suggested above. echo * echoes a list of all files as stated echo t*.c echoes test.c because that's the only such file in my /home echo a*.c echoes a*.c apparently because there are no a*.c files at all So if there are no matches, it reverts to echoing the string rather than emitting an error like ls would. Is there a more general rule behind that behavior? I ask because I also have a C program, in this case evaluating command-line expressions which can be, say, a*b, and I've never (so far) had any problem. Is that just lucky because there never happened to be any filename matches? -- John Forkosh ( mailto: j@f.com where j=john and f=forkosh )