From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3444 invoked by alias); 14 May 2015 17:30:23 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 35133 Received: (qmail 14063 invoked from network); 14 May 2015 17:30:10 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=QJ1WxdNiNEy8Rx1lhsV51KZSX3ZOpNIbdcBBFTczr2c=; b=EZnUtNSfIVAPcUM1eZn5Pkq2MYRIpvcwPTwCT0i/mLmnW09W0+Z+59jOPLGUXoe8+w Xbaz2UNpwKnZxKfkwGPZfT6li5NiUsJgHaet+ddTwQkq3LjQ09n8E3xsn2/M47ioFfM2 oflOcbnDtOjQcCJ9A0tUQkIweNCFyLrfr/GglZ3B7w5IqA2yqMqsP5dydaRC3tBLZdgQ b1TzHtaO+lPKeHqtBJ9t0DmODMpgut6Qf8DvVd86P9QX9Xy1mn6VqPk6nLEh4TWdT8Z8 P72NdX1duPy+bwkC0cU87eb3AEwd0SOP5uQvwz7nFKVUnjQnj6OE/eC9KyOaKYJp54iN ItgA== X-Gm-Message-State: ALoCoQkfhQqAVKo2ajYE5kmSaQbCgZkJF/pH7BrrDmjF7aUMTaqVtd4AHBaRAj5zu76bQjpluNOJ X-Received: by 10.202.63.212 with SMTP id m203mr4221009oia.35.1431624606420; Thu, 14 May 2015 10:30:06 -0700 (PDT) From: Bart Schaefer Message-Id: <150514103003.ZM30746@torch.brasslantern.com> Date: Thu, 14 May 2015 10:30:03 -0700 In-Reply-To: <20150514165557.59f6bdc9@pwslap01u.europe.root.pri> Comments: In reply to Peter Stephenson "Re: 'case' pattern matching bug with bracket expressions" (May 14, 4:55pm) References: <55549FB2.80705@inlv.org> <20150514154238.0e547ff0@pwslap01u.europe.root.pri> <5554C3A5.4030205@inlv.org> <20150514165557.59f6bdc9@pwslap01u.europe.root.pri> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: 'case' pattern matching bug with bracket expressions MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On May 14, 4:55pm, Peter Stephenson wrote: } } It occurs to me that other shells will treat whitespace as ending a } pattern for syntactic reasons, even if logically it can't: } } [[ ' ' = [ ] ]] } } works in zsh, but is a parse error in bash. Right, and your patch in 35131 does not change that. Arguably (in POSIX mode, at least) the space should need to be escaped? Even in bash the space can be left unescaped in some contexts; e.g. schaefer@burner:~$ var=' ' schaefer@burner:~$ echo ${var//[ ]/foo} foo I guess it's a quoting thing: schaefer@burner:~$ case " " in ( [" "] ) echo OK;; esac OK In ${...} the space is already implicitly quoted, but quoting it again doesn't change anything: schaefer@burner:~$ echo ${var//[" "]/foo} foo schaefer@burner:~$ var='"' schaefer@burner:~$ echo ${var//[" "]/foo} " Anyway, this is one of the rare cases where I don't think it would be terrible if this changed in native zsh mode too, as long as the quoted examples, like the above, don't break. -- Barton E. Schaefer