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 16584
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx (Zsh hackers list)
- Subject: Re: BUG? - 4.0.2 - parameter substitution won't double backslashes in values
- Date: Thu, 07 Feb 2002 10:33:55 +0000
- In-reply-to: "Derek Peschel"'s message of "Wed, 06 Feb 2002 20:39:26 PST." <20020206203926.A10484@xxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
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 <pws@xxxxxxx> 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.
**********************************************************************
Messages sorted by:
Reverse Date,
Date,
Thread,
Author