Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Handling Double-quoted backslash

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