zsh-workers
 help / color / mirror / code / Atom feed
From: Dan Nelson <dnelson@allantgroup.com>
To: DervishD <raul@viadomus.com>
Cc: Zsh <zsh-workers@sunsite.dk>
Subject: Re: Incompatibility when Zsh invoked as 'sh'
Date: Sun, 3 Feb 2002 20:51:22 -0600	[thread overview]
Message-ID: <20020204025121.GI6310@dan.emsphone.com> (raw)
In-Reply-To: <E16XVpG-0006tm-00@DervishD.viadomus.com>

In the last episode (Feb 04), DervishD said:
>     The problem is a 'case' like this (abbreviated):
> 
>     case "$1" in
>         [*)  ....
>             ;;
>         *)   ....
>             ;;
>     esac
> 
>     Well, the error is the '[*' pattern, which zsh says is a 'bat
> pattern'. Bash treats it as the regex 'match an opening bracket and
> anything after it', but zsh doesn't.

couple datapoints:

ash does not complain; args starting with a bracket match the 1st case.

pdksh-5.2.14 run as sh does not complain, but only the literal argument
  [* matches.

The ash manpage, at least, explicitly allows this case:

     A left bracket ([) introduces a character class.  The end of the
     character class is indicated by a ``]''; if the ``]'' is missing
     then the ``['' matches a ``['' rather than introducing a character
     class.

I don't have a link to the new Single Unix spec at the moment; what's
it say?

-- 
	Dan Nelson
	dnelson@allantgroup.com


  reply	other threads:[~2002-02-04  2:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-03 23:13 DervishD
2002-02-04  2:51 ` Dan Nelson [this message]
2002-02-04  3:46   ` Bart Schaefer
2002-02-04 10:14     ` Peter Stephenson
2002-02-04 10:06 DervishD
2002-02-04 10:07 DervishD

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=20020204025121.GI6310@dan.emsphone.com \
    --to=dnelson@allantgroup.com \
    --cc=raul@viadomus.com \
    --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).