Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Why this expansion doesn't work?
- X-seq: zsh-users 8595
- From: DervishD <zsh@xxxxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Why this expansion doesn't work?
- Date: Sun, 13 Mar 2005 10:39:15 +0100
- Cc: Zsh Users <zsh-users@xxxxxxxxxx>
- In-reply-to: <1050312204940.ZM12046@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>
Hi Bart :)
* Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> dixit:
> On Mar 12, 11:14am, DervishD wrote:
> } Subject: Why this doesn't work?
> As long as I'm passing out netiquette lessons, I might as well say
> that it would be nice if the word "this" in that Subject had been
> replaced by a slightly more descriptive phrase.
Yes, you're right, but I couldn't think of a more apropriate
subject at the time, sorry O:)) Next time I'll use a better and more
descriptive subject.
> } $ eval printf -- "Hello\\n"
> } Hello$
> If this is really what you're seeing, then something is indeed wrong.
> 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 and yes, I see
'Hellon' and not 'Hello'. I don't know why, because the options are
the same in both terminals (I've double checked that) :???
On every new terminal I see 'Hellon'.
> } $ eval printf -- "Hello\\\n"
> } Hello<newline>
> } I mean, no newline character is output when using just two
> } backslashes, and I don't understand that.
> Remember that when you use "eval" the command line is actually parsed
> twice. So
> eval printf -- "Hello\\n"
> is equivalent to
> printf -- Hello\n
>
> 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\"
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? That would avoid the stupidity from the user
(that is, me) you can see above O:) I've tried the eval command with
the double quotes quoted and works perfectly ;)
Thanks a lot for answering, Bart, and my excuses for the poor
subject O:)
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:
Reverse Date,
Date,
Thread,
Author