Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Printing square brackets and backslashes
- X-seq: zsh-users 9547
- From: DervishD <zsh@xxxxxxxxxxxx>
- To: Chris Johnson <cjohnson@xxxxxxxxxx>
- Subject: Re: Printing square brackets and backslashes
- Date: Mon, 24 Oct 2005 10:16:50 +0200
- Cc: Zsh Users <zsh-users@xxxxxxxxxx>
- In-reply-to: <20051024003033.GA2835@xxxxxxxxxxxxxxxx>
- Mail-followup-to: Chris Johnson <cjohnson@xxxxxxxxxx>,	Zsh Users <zsh-users@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Organization: DervishD
- References: <20051023214319.GA633@DervishD> <20051024000408.GA1124@DervishD> <20051024003033.GA2835@xxxxxxxxxxxxxxxx>
    Hi Chris :)
 * Chris Johnson <cjohnson@xxxxxxxxxx> dixit:
> DervishD sent me the following 0.9K:
> 
> > >     Hi all :)
> > > 
> > >     $ print \[\\\]
> > >     []
> > >     $ /bin/echo -e \[\\\]
> > >     [\]
> > >     $ print -r \[\\\]
> > >     [\]
> > >     $ print \\
> > >     \
> > 
> >     I can understand the first case, but I don't understand the last
> > one: in the first case, what I misunderstood is that the shell quotes
> > the chars, producing "[\]" and "print" prints them, interpreting some
> > escape directives: "[]". But in the last case, nothing should then be
> > printed, because zsh quotes the backslash and "print" gets a single
> > backslash, that is, an empty escape directive that shouldn't print
> > anything :? Is "print" assuming that a single backslash is not an
> > empty escape directive? Is a single, isolated backslash a synonim for
> > "\\"?
> 
> This is in the zsh user's guide at:
> 
>    http://zsh.sourceforge.net/Guide/zshguide03.html#l32
> 
> Look under section 3.2.1, Builtins for printing.
    Thanks!. I read the Guide a time ago and obviously I missed this.
Thanks again, Chris, it has been very useful :)
    Raúl Núñez de Arenas Coronado
-- 
Linux Registered User 88736 | http://www.dervishd.net
http://www.pleyades.net & http://www.gotesdelluna.net
It's my PC and I'll cry if I want to...
Messages sorted by:
Reverse Date,
Date,
Thread,
Author