From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5526 invoked from network); 7 Feb 2002 10:34:32 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 7 Feb 2002 10:34:32 -0000 Received: (qmail 4864 invoked by alias); 7 Feb 2002 10:34:23 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16584 Received: (qmail 4853 invoked from network); 7 Feb 2002 10:34:23 -0000 To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: BUG? - 4.0.2 - parameter substitution won't double backslashes in values In-reply-to: "Derek Peschel"'s message of "Wed, 06 Feb 2002 20:39:26 PST." <20020206203926.A10484@eskimo.eskimo.com> Date: Thu, 07 Feb 2002 10:33:55 +0000 Message-ID: <23823.1013078035@csr.com> From: Peter Stephenson Derek Peschel wrote: > I want to write the elements of $dirstack out to a file, separated by > newlines. If an element in $dirstack contains a newline, I want to write > a backslash before the newline in the file. Parameter substitution > managed that: > > print ${dirstack[0]/ > /\\\\ > } >... I haven't looked at this in detail, but you might be coming a bit unstuck by using `print' instead of `print -r'. The latter will avoid interpreting the backslashes at that point, which is almost certainly closer to what you want. -- Peter Stephenson Software Engineer CSR Ltd., Science Park, Milton Road, Cambridge, CB4 0WH, UK Tel: +44 (0)1223 392070 ********************************************************************** The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. **********************************************************************