From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Tolpin Message-Id: <200403182300.i2IN0p5T095713@adat.davidashen.net> To: 9fans@cse.psu.edu Subject: Re: [9fans] ls, rc question In-Reply-To: <405A1D45.9030400@swtch.com> Date: Fri, 19 Mar 2004 03:00:51 +0400 Topicbox-Message-UUID: 37578796-eacd-11e9-9e20-41e7f4b1d025 I am not asking why there are two file names in the directory listing. I understand it. I think that behaviours of rc and ls are confusing. I would either expect rc's globbing to only match one path name, or ls to display all files. man rc says 'A pattern is replaced by a list of arguments, one for each path name matched'. Not for each directory entry. For each path name. There is one path name /dev/user for two files. cpu% ls -q /dev|grep user (0000000000000015 0 00) /dev/user (000000000000000c 0 00) /dev/user Globbing expands this to two elements: cpu% echo /dev/user* /dev/user /dev/user I think this is not what the manual says. Then, cpu% ls -q /dev/user* (0000000000000015 0 00) /dev/user (0000000000000015 0 00) /dev/user I understand why it is so. But I think that consistency is sacrificed for simplicity. Either rc should do what the manual says and return one match for /dev/user* (so that /dev/user* and /dev/user is the same thing), or ls -q /dev/user should recursively list all directory entries matching the path name. David Tolpin