From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5077 invoked by alias); 11 Oct 2014 03:31:28 -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: 33430 Received: (qmail 25229 invoked from network); 11 Oct 2014 03:31:27 -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 From: Bart Schaefer Message-id: <141010203135.ZM32246@torch.brasslantern.com> Date: Fri, 10 Oct 2014 20:31:35 -0700 In-reply-to: <20141011003817.GA2786@localhost.localdomain> Comments: In reply to Han Pingtian "Re: (s) splitting - is there any way to provide "dynamic" separator" (Oct 11, 8:38am) References: <5436A310.7040101@gmail.com> <141009184525.ZM29875@torch.brasslantern.com> <5437856D.3050700@gmail.com> <20141011003817.GA2786@localhost.localdomain> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: (s) splitting - is there any way to provide "dynamic" separator MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Oct 11, 8:38am, Han Pingtian wrote: } } % a=11::22:33;print -l ${(ps.\0.)a//:/$'\0'} } 11 } 22 } 33 } % a=11::22:33;print -l "${(ps.\0.)a//:/$'\0'}" } 11$''$''22$''33 } % } } Looks like $'\0' in double-quotes is converted to $'' and it doesn't equal } to \0 ? Although it looks like an expansion, $'...' is actually a form of quotes, and therefore cannot be used inside a double-quoted string. The \0 is actually being removed by "print -l". Add the -R option: torch% a=11::22:33;print -l -R "${(ps.\0.)a//:/$'\0'}" 11$'\0'$'\0'22$'\0'33 torch%