From mboxrd@z Thu Jan 1 00:00:00 1970 Message-Id: <200206130007.UAA16573@math.psu.edu> To: 9fans@cse.psu.edu Subject: Re: [9fans] bug or a feature? In-Reply-To: Your message of "Wed, 12 Jun 2002 16:49:21 PDT." <4109a95286b1ab5e60c5fff7b21cfa01@collyer.net> From: Dan Cross Date: Wed, 12 Jun 2002 20:07:28 -0400 Topicbox-Message-UUID: ab2ef6a2-eaca-11e9-9e20-41e7f4b1d025 > I've always understood the utility of passing through a failed glob pattern > to be that some programs do their own globbing (as I recall, find and tar > are the two main candidates, maybe restor) and if the user forgets > to (or deliberated doesn't) quote the pattern and it doesn't match anything, > the program gets to glob it. How useful this is may depend upon your > feelings about quoting in general. The argument around, ``what does quoting mean to me?'' is probably beyond the scope of this discussion. Find tends not to be an issue, since we don't have a find on Plan 9. > I do think that the current behaviour is more helpful than expanding > to a null list would be. If the pattern doesn't match, you've very likely > made a mistake. I'd rather have ``cat ?akefile'' print > > cat: can't open ?akefile: '?akefile' directory entry not found > > and exit than have it just sit there reading standard input. I disagree for reason that the current behavior is ambiguous, as illustrated by the following example: term% mkdir t term% cd t term% ls term% touch 'foo?' term% ls -l --rw-rw-r-- M 14826 cross cross 0 Jun 12 19:59 foo? term% echo foo? foo? term% echo bar? bar? term% echo Rats! Rats! term% Of course, it's probably foolish to name a file, ``foo?'', but one might imagine contexts in which that happens. Besides, if the expansion of the null argument list is propogated into the program's argument vector, then it will indeed look for something non-existant, though the error message might be less useful than otherwise. - Dan C. (And while we're at it, can we add ``else'' to Plan 9 rc?)