From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9229 invoked by alias); 31 Oct 2014 20:04:43 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 19299 Received: (qmail 25496 invoked from network); 31 Oct 2014 20:04:39 -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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-Originating-IP: [80.3.229.105] X-Spam: 0 X-Authority: v=2.1 cv=RdIeCjdv c=1 sm=1 tr=0 a=uz1KDxDNIq33yePw376BBA==:117 a=uz1KDxDNIq33yePw376BBA==:17 a=NLZqzBF-AAAA:8 a=kj9zAlcOel0A:10 a=q2637JyQANxm6A8GDqEA:9 a=CjuIK1q_8ugA:10 Date: Fri, 31 Oct 2014 19:59:03 +0000 From: Peter Stephenson To: Zsh Users Subject: Re: first adventures Message-ID: <20141031195903.167d3e05@pws-pc.ntlworld.com> In-Reply-To: <5453D0AE.6020705@eastlink.ca> References: <544D2D6F.8030505@eastlink.ca> <20141026175257.2611487b@pws-pc.ntlworld.com> <544FD6DD.7010806@eastlink.ca> <141028210510.ZM10784@torch.brasslantern.com> <54510A96.20009@eastlink.ca> <141029134624.ZM15681@torch.brasslantern.com> <545178DF.1040600@eastlink.ca> <141029210738.ZM15833@torch.brasslantern.com> <5452ED18.7070208@eastlink.ca> <141030195906.ZM30057@torch.brasslantern.com> <5453D0AE.6020705@eastlink.ca> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.7; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 31 Oct 2014 11:10:54 -0700 Ray Andrews wrote: > One further question, I tried the ' (Q) ' flag to remove quotes, and it > works > as advertised, however trying to print individual array elements fails > whereas > they print fine with the ' (z) 'flag. Why is that? They're doing different things. (Q) really does just remove quotes, it doesn't split things into elements. (z) splits things into elements using the shell's normal rules, but doesn't remove quotes. You might be running up against the problem that if you combine them in the obvious way it doesn't do what you want because the splitting happens too late. That's a deliberate rule, it's just not convenient in this particular case --- there are so many cases for parameter expansion it's quite impossible to get them all to work in the simplest way. So starting with % print -rl ${line} 'one two' "buckle my shoe" three\ four (printing the raw string arguments one per line) you get % print -rl ${(Qz)line} one two buckle my shoe three four which isn't what you want. But you can use a nested expansion to get the quotes removed after zplitting: % print -rl ${(Q)${(z)line}} one two buckle my shoe three four Finally, you've got exactly the right set of arguments as simple strings. -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/