From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1027 invoked by alias); 1 Nov 2014 07:51:50 -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: 19301 Received: (qmail 17159 invoked from network); 1 Nov 2014 07:51:47 -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.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ZKE1KA5IaZsSlG1WOPXd9uVneBZqk5to2gctOFvjy2I=; b=ETBeI9xaA2igEDlFrxWcs9exkdzPFR3tj2Pu4tnbRbWGF3NZK7Bw9mZPmsf7lh18D3 sqpkQ6PU5F+1rxSDdTEv2k18ATLooHIc8wQ7B1i9199qdfvHrI/TOz9AZSFJwvIdXYgM WEcygj84Jj27q4D9gGVVw+Q/5cxZfCgfOe14xbdqv5WIgLbzOKionj/19Hx/Yp31irQo lgqDT4liecnTwX+/WZT5DzjczSxrEkOMhNKfDhixl9hEwqibkA4EpO3bPSyHmL5f6J4n 3tDAm53B6RwMZK3pt3LMNWZKKHC7EbqVaVMjd2TQiT3lhk5hOcWnc2yP6SCq/lod+R7X 7kRA== MIME-Version: 1.0 X-Received: by 10.50.171.138 with SMTP id au10mr2412381igc.4.1414828304800; Sat, 01 Nov 2014 00:51:44 -0700 (PDT) In-Reply-To: <545460D9.2090804@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> <20141031195903.167d3e05@pws-pc.ntlworld.com> <545460D9.2090804@eastlink.ca> Date: Sat, 1 Nov 2014 08:51:44 +0100 Message-ID: Subject: Re: first adventures From: Mikael Magnusson To: Ray Andrews Cc: Zsh Users Content-Type: text/plain; charset=UTF-8 On Sat, Nov 1, 2014 at 5:26 AM, Ray Andrews wrote: > On 10/31/2014 12:59 PM, Peter Stephenson wrote: > > Strange, I'm getting double posts both sending and receiving. >> >> 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. > > Right. Somehow I assumed the breakdown as well, tho there's no reason I > should have. [...] > Using > (( $#functrace == 1 )) && TLC=(${(Q)${(z)ZSH_DEBUG_CMD}}) > } > > $ test 'one \n' "two \n" buckle \n > My unexpanded arguments were: test2 one \n two \n buckle n > ...and my arguments broken to an array: > > two: one \n > three: two \n > four: buckle > five: n << Why does it remove the backslash? \n is the same as for example "n", which is one level of quoting, which (Q) removes. Note that \n is not special to the shell in any way other than being a quoted letter n. Many builtins parse the _string_ \n as a newline, but \n on the raw input line after parsing into separate arguments is not the string \n, but the string n. -- Mikael Magnusson