From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6143 invoked from network); 7 Feb 2002 13:20:12 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 7 Feb 2002 13:20:11 -0000 Received: (qmail 36 invoked by alias); 7 Feb 2002 13:20:00 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16586 Received: (qmail 23 invoked from network); 7 Feb 2002 13:19:58 -0000 Date: Thu, 7 Feb 2002 05:19:55 -0800 From: Derek Peschel To: zsh-workers@sunsite.dk Subject: Re: BUG? - 4.0.2 - parameter substitution won't double backslashes in values Message-ID: <20020207051955.A26840@eskimo.eskimo.com> References: <20020206203926.A10484@eskimo.eskimo.com> <23823.1013078035@csr.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <23823.1013078035@csr.com>; from pws@csr.com on Thu, Feb 07, 2002 at 10:33:55AM +0000 On Thu, Feb 07, 2002 at 10:33:55AM +0000, Peter Stephenson wrote: > 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. Good advice. I did have to read the sentence a couple of times to be absolutely sure you were telling me to use "print -r". But I would still expect some change (a backspace should change to "\b" when using "print", or "\b" should change to "\\b" when using "print -r"). And there is absolutely none as far as I can tell. And I think that's odd. -- Derek