From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24262 invoked from network); 14 Mar 2005 10:49:15 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 14 Mar 2005 10:49:15 -0000 Received: (qmail 82767 invoked from network); 14 Mar 2005 10:49:08 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 14 Mar 2005 10:49:08 -0000 Received: (qmail 12868 invoked by alias); 14 Mar 2005 10:49:01 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8603 Received: (qmail 12857 invoked from network); 14 Mar 2005 10:49:01 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 14 Mar 2005 10:49:01 -0000 Received: (qmail 81889 invoked from network); 14 Mar 2005 10:49:01 -0000 Received: from ns9.hostinglmi.net (213.194.149.146) by a.mx.sunsite.dk with SMTP; 14 Mar 2005 10:48:49 -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 1DAn7h-0006r5-L4; Mon, 14 Mar 2005 11:48:34 +0100 Date: Mon, 14 Mar 2005 11:50:12 +0100 From: DervishD To: Bart Schaefer Cc: Zsh Users Subject: Re: Why this expansion doesn't work? Message-ID: <20050314105012.GC28692@DervishD> Mail-Followup-To: Bart Schaefer , Zsh Users References: <20050312101450.GA5656@DervishD> <1050312204940.ZM12046@candle.brasslantern.com> <20050313093915.GA81@DervishD> <1050313171626.ZM18705@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: <1050313171626.ZM18705@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 - [0 0] / [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=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 Hi Bart :) * Bart Schaefer 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 knows... > } > 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' > Hello > zagzig% 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...