Zsh Mailing List Archive
Messages sorted by:
Re: Why this expansion doesn't work?
- X-seq: zsh-users 8603
- From: DervishD <zsh@xxxxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Why this expansion doesn't work?
- Date: Mon, 14 Mar 2005 11:50:12 +0100
- Cc: Zsh Users <zsh-users@xxxxxxxxxx>
- In-reply-to: <1050313171626.ZM18705@xxxxxxxxxxxxxxxxxxxxxxx>
- Mail-followup-to: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, Zsh Users <zsh-users@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Organization: DervishD
- References: <20050312101450.GA5656@DervishD> <1050312204940.ZM12046@xxxxxxxxxxxxxxxxxxxxxxx> <20050313093915.GA81@DervishD> <1050313171626.ZM18705@xxxxxxxxxxxxxxxxxxxxxxx>
Hi Bart :)
* Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> dixit:
> } > What you should see is "Hellon", not "Hello".
> } That's weird :(( I still have open the console where I saw that,
> } but in a new virtual console that doesn't happen
> Cosmic rays.
I'm seriouly thinking about that XDDD Probably the cause have
been the cosmic rays... hitting my brain. Or my poor eye quality, who
> } > The first parse removes the quotes and one of the backslashes, and the
> } > second parse removes the remaining backslash.
> } So I must use something like:
> } eval printf -- \"Hello\\n\"
> Yes, except of course that means something considerably different when
> there are spaces or metacharacters in the (no longer double-quoted on
> the first parse) string. More likely you want
> eval printf -- \""Hello\\n"\"
Errr... yes. I'll fix it right now. I'm using this in a script
and in a couple of places I think I'll need double quotes (in
addition to the quoted ones...).
> } I forgot that the double quotes were removed :((( Is there any
> } way of seeing how a command line is parsed *just before* being
> } executed by the shell?
> setopt xtrace
I forgot. I use xtrace to see the progress in scripts, but I
never used it for seeing expansions O:) Thanks a lot for the advice.
> (or the equivalent "set -x"). Note that xtrace in recent versions of
> zsh re-quotes the output so that it's suitable for cut-and-paste; old
> versions (4.0.x and before) show the fully-unquoted result, but there
> it's difficult to see where the shell split strings into words.
I'm using 4.2.x now.
> So e.g.
> zagzig% set -x
> zagzig% eval printf -- \""Hello\\n"\"
> +Src/zsh:2> eval printf -- '"Hello\n"'
> +(eval):1> printf -- 'Hello\n'
Nice :)) Thanks a lot, Bart. You're fantastic :)
Raúl Núñez de Arenas Coronado
Linux Registered User 88736
http://www.dervishd.net & http://www.pleyades.net/
It's my PC and I'll cry if I want to...
Messages sorted by: