From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 917 invoked from network); 13 Mar 2005 09:37:48 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 13 Mar 2005 09:37:48 -0000 Received: (qmail 73128 invoked from network); 13 Mar 2005 09:37:40 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 13 Mar 2005 09:37:40 -0000 Received: (qmail 19540 invoked by alias); 13 Mar 2005 09:37:30 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8595 Received: (qmail 19520 invoked from network); 13 Mar 2005 09:37:29 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 13 Mar 2005 09:37:29 -0000 Received: (qmail 72010 invoked from network); 13 Mar 2005 09:37:29 -0000 Received: from ns9.hostinglmi.net (213.194.149.146) by a.mx.sunsite.dk with SMTP; 13 Mar 2005 09:37:24 -0000 Received: from 212.red-80-35-44.pooles.rima-tde.net ([80.35.44.212] helo=localhost) by ns9.hostinglmi.net with esmtpa (Exim 4.44) id 1DAPXI-0005Hd-Nb; Sun, 13 Mar 2005 10:37:25 +0100 Date: Sun, 13 Mar 2005 10:39:15 +0100 From: DervishD To: Bart Schaefer Cc: Zsh Users Subject: Re: Why this expansion doesn't work? Message-ID: <20050313093915.GA81@DervishD> Mail-Followup-To: Bart Schaefer , Zsh Users References: <20050312101450.GA5656@DervishD> <1050312204940.ZM12046@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1050312204940.ZM12046@candle.brasslantern.com> User-Agent: Mutt/1.4.2.1i Organization: DervishD X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ns9.hostinglmi.net X-AntiAbuse: Original Domain - sunsite.dk X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - dervishd.net X-Source: X-Source-Args: X-Source-Dir: X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 Hi Bart :) * Bart Schaefer 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 > } 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...