9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Lucio De Re <lucio@proxima.alt.za>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] Ugly hack
Date: Mon, 17 Feb 2003 07:27:51 +0200	[thread overview]
Message-ID: <20030217072751.R9084@cackle.proxima.alt.za> (raw)
In-Reply-To: <a5a04673427d411f20d1266adf3704da@plan9.bell-labs.com>; from Russ Cox on Sun, Feb 16, 2003 at 10:40:31AM -0500

On Sun, Feb 16, 2003 at 10:40:31AM -0500, Russ Cox wrote:
>
> My impression was that you were trying to make
>
> 	echo */
> and
> 	echo */.
>
> match only the directories.  The fact that
>
Agreed.  The original intent was indeed that.

> 	access("/adm/users/.", 0)
>
> succeeds is a kernel bug and not something the shell
> should be trying to hack around.  The dotdot paper
> shows a good example (ksh) of what confusion
> results when user-level programs try to fix kernel bugs
> (in that case, the handling of dotdot).
>
Appreciated.  That was the problem raised by Geoff and he was quite
right to surmise where the problem originated.  However, the change I
made to the shell was flawed, so I both fixed my error _and_
accidentally bypassed the kernel flaw.  I wasn't aiming to do the
latter.

> Put another way, the definition of */. is (on Unix
> or on Plan 9) all the valid paths you get by substituting
> a name in the current directory for the star.
> It so happens that this set is different on Plan 9,
> and that is in fact a bug caused by early cleaning
> of the names, and nothing more.  It's not the shell's
> fault, and it's certainly not the shell's place to patch
> it up.
>
Accepted.  But I've no idea how to fix it, so I leave that to superior
intellects.  That should cause pdksh to come right of its own accord.

> In the process you appear to have improved rc's
> performance somewhat, by using the extra information
> you get from a Plan 9 readdir as opposed to a Unix readdir,
> and that's nice, but not what I was referring to.
>
Indeed.  As long as we agree that my changes to the shell were not
aimed at fixing Geoff's anomaly, but rather to fix my poor
understanding of the shell code in the initial attempt (which failed
miserably on /bin/*/*, incidentally).

++L


  reply	other threads:[~2003-02-17  5:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-15 15:46 Lucio De Re
2003-02-15 16:18 ` Sam
2003-02-15 16:21   ` Dan Cross
2003-02-15 16:29   ` Lucio De Re
2003-02-15 23:56 ` Geoff Collyer
2003-02-16  9:20   ` Lucio De Re
2003-02-16  9:25     ` Lucio De Re
2003-02-16 12:18       ` Lucio De Re
2003-02-16 12:45         ` Lucio De Re
2003-02-16 14:19 ` Russ Cox
2003-02-16 15:00   ` Lucio De Re
2003-02-16 15:31     ` David Butler
2003-02-16 15:40     ` Russ Cox
2003-02-17  5:27       ` Lucio De Re [this message]
2003-02-17  9:53 ` John Kodis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030217072751.R9084@cackle.proxima.alt.za \
    --to=lucio@proxima.alt.za \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).