Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: BUG? - 4.0.2 - parameter substitution won't double backslashes in values
- X-seq: zsh-workers 16586
- From: Derek Peschel <dpeschel@xxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: BUG? - 4.0.2 - parameter substitution won't double backslashes in values
- Date: Thu, 7 Feb 2002 05:19:55 -0800
- In-reply-to: <23823.1013078035@xxxxxxx>; from pws@xxxxxxx on Thu, Feb 07, 2002 at 10:33:55AM +0000
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20020206203926.A10484@xxxxxxxxxxxxxxxxx> <23823.1013078035@xxxxxxx>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author