Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Handling Double-quoted backslash
- X-seq: zsh-users 15077
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Handling Double-quoted backslash
- Date: Sat, 22 May 2010 20:03:29 -0700
- In-reply-to: <alpine.LNX.2.01.1005221600590.5029@xxxxxxxxxxx>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <AANLkTineDxdmX6rYKFaq8MPMV-JM3skkSsJ69I7aNUfY@xxxxxxxxxxxxxx> <AANLkTilsi-UtdCZJuv9hNNQs3XIQG_8MRilmXYQMfXaR@xxxxxxxxxxxxxx> <alpine.LNX.2.01.1005221600590.5029@xxxxxxxxxxx>
On Sat, May 22, 2010 at 1:28 PM, Benjamin R. Haskell <zsh@xxxxxxxxxx> wrote:
> Interestingly, the shells aren't consistent across the board regardless
> of how they implement 'echo'. I don't think that makes one or the other
> "correct", per se (If anything, tcsh is in the minority, empirically).
I think what you've (re-)discovered is that csh-based shells don't
intepret backslashes within double quotes at all, whereas Bourne-based
shells interpret backslashes only when they precede certain special
characters that need escaping (which includes backslash).
You can see this more violently if you try using
dquote-bslash-dquote-dquote; tcsh et al. will simply choke with an
unmatched quote error, whereas sh et al. will produce a dquote.
I don't have any experience with psh (is that perl-based?) but it
seems odd that it interpolates "\n" as a newline but doesn't
interpolate "\\" as a single backslash.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author