From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19802 invoked by alias); 23 Jan 2016 01:49:17 -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: 37736 Received: (qmail 27029 invoked from network); 23 Jan 2016 01:49:17 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version:content-type; bh=xUNmEJhWrQDlUt+0DVD9pzg/nDpqD3IVELumTWmZuR0=; b=D6qqcjnqzanZ+7by6LpuMQ/pumL5PAKHpfmDHEqXRYVBEGH/R9/jq+1Qm0UhSE0EPS MwacZQ6bAI+De18R+ORKAFz3jW8LdLCWUlKM3DNYiM2AkygZnR8IAlWEbBV2TKHaQjXR NweJ9VL2M6St8yQA1GWAp77arRSei1QP6lH1e3pZhFlNweit5d8zAh/9KlWt9V+u3V+w pqq+2p67ioGMTbXHF+CbjQqY5LrlgRCXJTS60+SPfn7riNgyZtnkCuBoLZmhdRgElXPR Vek7uLwyHtFi8luF+JKyUIFeEMYgPAYYWecI/0uHz8vUi95CqoxM7Og62+n4W5aP2uj2 JVbA== 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=xUNmEJhWrQDlUt+0DVD9pzg/nDpqD3IVELumTWmZuR0=; b=OLaueohUlQsajncOLxELM9sQhdTnaW0AF3/Fqabs5KqV28cddLty9KK/ZySDio0vKy NwvBZ6aP982290IKpPNyEkKWmObWx0gXjd9QwQz0ed2jt1xNz8db79EDt2AytDmNyhtU nbsf3uVPoaXKhcLet61sz1B1kI2uxo/SFkbcfYU1BouiTUnUjE46JA1Vk5bTlkccsHkX pKGHtPpnrKgKLqX+HDf+8WBb5Siv8JeaAK3G6bC+zeoaCNX9oMRV78wQNxrmVCHgLs1y 1EbW2+tJlRYALH9tBpGu/PnZYXSdti53rfsEL+RIyaCM0bSZjfYyR1k6ux+H11tj9u7l PgFQ== X-Gm-Message-State: AG10YOQJR1NbCmf3oavaCxdJQgl6K5qWvdCVHDGs0+zMV8/1wKKUGsC0o/JJYlb0lhqJMw== X-Received: by 10.98.31.207 with SMTP id l76mr8590743pfj.134.1453513754562; Fri, 22 Jan 2016 17:49:14 -0800 (PST) From: Bart Schaefer Message-Id: <160122174949.ZM11794@torch.brasslantern.com> Date: Fri, 22 Jan 2016 17:49:49 -0800 In-Reply-To: <56A2C6A8.4090108@inlv.org> Comments: In reply to Martijn Dekker "Re: [BUG] quoting within bracket patterns has no effect" (Jan 23, 12:17am) References: <569C68AB.2010806@inlv.org> <20160118172434.2fb7d5b9@pwslap01u.europe.root.pri> <56A2C6A8.4090108@inlv.org> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: [BUG] quoting within bracket patterns has no effect MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jan 23, 12:17am, Martijn Dekker wrote: } } However, for variables there is now a new problem, the opposite of the } old one: unlike in every other shell, a range is not recognised even if } the variable is *not* quoted. So quoting a variable still has no effect, } it's just that range parsing from variables was disabled altogether. The } following code: } } myrange='a-z' } somevar='c' } case $somevar in } ( *[$myrange]* ) echo "$somevar is part of $myrange" ;; } esac } } outputs "c is part of a-z" on every shell except current zsh. This is related to long-standing behavior for zsh in native mode. In as-close-as-zsh-has-to-POSIX mode: schaefer[655] ARGV0=sh Src/zsh $ myrange='a-z' $ somevar='c' $ case $somevar in > ( *[$myrange]* ) echo "$somevar is part of $myrange" ;; > esac c is part of a-z $ In native mode you need to use $~param to activate pattern characters in the expanded value: schaefer[656] Src/zsh -f torch% myrange='a-z' torch% somevar='c' torch% case $somevar in case> ( *[$~myrange]* ) echo "$somevar is part of $myrange" ;; case> esac c is part of a-z torch% It's true that needing this inside a character class now differs from previous versions of zsh for native mode. I'm not sure it's possible to have it both ways.