From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18465 invoked by alias); 16 Feb 2016 09:43:49 -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: 37993 Received: (qmail 2982 invoked from network); 16 Feb 2016 09:43:48 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-AuditID: cbfec7f4-f79026d00000418a-e1-56c2ecf579ed Date: Tue, 16 Feb 2016 09:33:39 +0000 From: Peter Stephenson To: Zsh hackers list Subject: Re: Quoting problems Message-id: <20160216093339.3d0f4d0a@pwslap01u.europe.root.pri> In-reply-to: References: Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrILMWRmVeSWpSXmKPExsVy+t/xK7pf3xwKMzh3wcDiYPNDJgdGj1UH PzAFMEZx2aSk5mSWpRbp2yVwZTRfOc5UcI61Yu6bZ+wNjLtZuhg5OSQETCT2H97PBmGLSVy4 tx7I5uIQEljKKPHn7S1WCGcGk8T3+V9ZIJxzjBLHp1+Ecs4ySuxet48RpJ9FQFVi9s0L7CA2 m4ChxNRNs8HiIgJaEjtOnmQCsYUFZCX+/T8GVsMrYC+x58chsBpOgWCJQxcWMoPYQgIBEtcb IW7iF9CXuPr3ExPEffYSM6+cYYToFZT4Mfke2A/MQPM3b2tihbDlJTaveQs1R13ixt3d7BMY hWchaZmFpGUWkpYFjMyrGEVTS5MLipPScw31ihNzi0vz0vWS83M3MUIC+ssOxsXHrA4xCnAw KvHwcngcChNiTSwrrsw9xCjBwawkwvvvFVCINyWxsiq1KD++qDQntfgQozQHi5I479xd70OE BNITS1KzU1MLUotgskwcnFINjMmXD7r8VdzxuNxDkelYlRSj3SK/r+Uqx4V8VtaeUlHv2ZT+ b+kEo2Pb/B4WHr5ymuPImcXmWp9/PL9p9o19xTsbf6t3q1a/rszads2ydud14YgWIf1b3sU+ QRmnp1jfmS4xu0hRdfYc6ekngtYbRFfYuJ/3SHlzm9evJcso+FdPijNr/yvbLCWW4oxEQy3m ouJEAFlQwvBkAgAA On Tue, 16 Feb 2016 08:53:05 +0100 Sebastian Gniazdowski wrote: > Hello, > # source test_script > a > # source ./a > ./a:156: unmatched " > ./a:157: invalid function definition > > > It's about following line: > [[ $#exp -eq 1 && "${exp[1]//\}" = "${word//\}"(|\(N\)) ]] > > The first and second backslash aren't quoted and cause the two '{' to > be unbound. Looking at your code, I think you'll find this is because you're using echo without the option not to expand bacslashes. Try "echo -E" or "print -r". (I'd recommend "print" if this is zsh-specific as echo is mostly there for backward compatibility, although there's no reason it shouldn't work here.) pws