zsh-workers
 help / color / mirror / code / Atom feed
From: Cuong Manh Le <cuong.manhle.vn@gmail.com>
To: zsh-workers@zsh.org
Subject: Why zsh chose to be non-compliant in pattern matching
Date: Fri, 26 Feb 2016 08:02:51 +0700	[thread overview]
Message-ID: <CALS7p_eC1W57J671TP5GDpw4=N+__+w4b+a0Gkgaa3swKq76fA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 572 bytes --]

POSIX documentation for pattern matching (
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_13_01)
said that any quoted characters in pattern will be match literally.

AFAICT, `["!"a]` will match `!` or `a`, most of shell behave like that
except zsh (and also ksh):

case a in ["!"a]) echo 1;; esac


print nothing. While:

case b in ["!"a]) echo 1;; esac


print 1. zsh treats `["!"a]` the same as `[!a]`.

Is there any reason for this behavior?

PS: The full question can be seen here
http://unix.stackexchange.com/q/265431/38906

Thanks.

             reply	other threads:[~2016-02-26  2:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-26  1:02 Cuong Manh Le [this message]
2016-02-26  8:43 ` Bart Schaefer
2016-02-29 10:00   ` Cuong Manh Le
2016-02-29 10:27     ` Peter Stephenson
2016-02-29 22:28       ` Martijn Dekker

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='CALS7p_eC1W57J671TP5GDpw4=N+__+w4b+a0Gkgaa3swKq76fA@mail.gmail.com' \
    --to=cuong.manhle.vn@gmail.com \
    --cc=zsh-workers@zsh.org \
    /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).