From: Vincent Lefevre <vincent@vinc17.org>
To: zsh-workers@sunsite.dk
Subject: Re: bug in patterns used for filename expansion (e.g. a[b/c]d)
Date: Tue, 9 Oct 2007 18:00:58 +0200 [thread overview]
Message-ID: <20071009160058.GI22340@prunille.vinc17.org> (raw)
In-Reply-To: <071009082413.ZM26445@torch.brasslantern.com>
On 2007-10-09 08:24:13 -0700, Bart Schaefer wrote:
> That said, the thing zsh-as-ksh is most like is ksh88.
I think that the manual should say that, because it seems that the
provided AT&T ksh is generally ksh93 (e.g. under Debian and Mac OS X).
>
> } vin:~> ksh --version
> } zsh 4.3.4 (i686-pc-linux-gnu)
> } vin:~> ksh
> } $ ls a[b/*
> } ls: a[b/*: No such file or directory
> }
> } vin:~> ksh93
> } $ ls a[b/*
> } > ksh93: syntax error: `[' unmatched
>
> This is exactly the difference between bash and ksh as mentioned on
> the austin-group, is it not?
No, Geoff Clare said in the austin-group is:
$ ls a[b/*
a[b/file
in both cases. This is also what I obtain with AT&T ksh93 under Mac OS X.
So, only zsh, when run as ksh, is different. Is this a bug in zsh or does
ksh88 behave like that? (I don't have ksh88, so I can't test.)
> } vin:~> ksh -c 'ls a[b/*'
> } ls: a[b/*: No such file or directory
> } vin:~> ksh93 -c 'ls a[b/*'
> } ls: a[b/*[: No such file or directory
>
> Where'd that extra '[' come from? I'd say this is a ksh bug.
Yes, this is strange and ksh93 under Mac OS X behaves differently, so
I assume that this is a bug in Debian's ksh package.
>
> } vin:~> touch 'a[b/*'
> } vin:~> ksh93 -c 'ls a[b/*'
> } ls: a[b/*[: No such file or directory
> } vin:~> ksh -c 'ls a[b/*'
> } a[b/*
>
> Again modulo the extra-bracket bug, this is the bash v. ksh thing.
No:
vin:~> ll a\[b
-rw-r--r-- 1 vlefevre vlefevre 0 2007-10-09 16:10:36 *
-rw-r--r-- 1 vlefevre vlefevre 0 2007-10-09 16:25:17 *[
-rw-r--r-- 1 vlefevre vlefevre 0 2007-10-09 16:04:18 file
vin:~> bash -c 'ls a[b/*'
a[b/* a[b/*[ a[b/file
and with ksh from Mac OS X (sh (AT&T Labs Research) 1993-12-28 p),
I get the same behavior, while zsh gives:
vin:~> ksh -c 'ls a[b/*'
a[b/*
--
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)
next prev parent reply other threads:[~2007-10-09 16:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-09 12:40 Vincent Lefevre
2007-10-09 12:59 ` Peter Stephenson
2007-10-09 14:12 ` Vincent Lefevre
2007-10-09 14:46 ` Peter Stephenson
2007-10-09 15:24 ` Bart Schaefer
2007-10-09 16:00 ` Vincent Lefevre [this message]
2007-10-09 15:00 ` Stephane Chazelas
2007-10-09 15:30 ` Bart Schaefer
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=20071009160058.GI22340@prunille.vinc17.org \
--to=vincent@vinc17.org \
--cc=zsh-workers@sunsite.dk \
/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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
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).