From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <50440c6f4b6946137968d772dcf08a2a@hamnavoe.com> To: 9fans@cse.psu.edu Subject: Re: [9fans] ls, rc question -- proposed change to rc/glob.c From: Richard Miller In-Reply-To: <59B1952A-797D-11D8-8706-000A95B984D8@mightycheese.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Fri, 19 Mar 2004 08:31:25 +0000 Topicbox-Message-UUID: 3802ae5a-eacd-11e9-9e20-41e7f4b1d025 > i don't like changing the shell to mask kernel behavior. it leads > to surprises. consider unix shells that `fix' cd in a way that it > differs from the chdir system call. But filename pattern matching in the shell is already different from just reading a directory in the kernel. By saying 'ls /tmp/*.c' instead of 'ls /tmp' you are asking for a selection of names. The question is how many times to select a name which matches more than one file. As David has pointed out, the rc manual at present unambiguously says "A pattern is replaced by a list of arguments, one for each path name matched" -- not "one for each file matched". So if rc isn't changed, the manual does need to be corrected. But I would vote for changing rc. Although I am (after some years of experience) sufficiently used to unions that I don't find the behaviour surprising, I do find it irritating: for example, when doing 'grep XXX *.c' in a union directory produces duplicate output for files which occur in more than one underlying directory. -- Richard