From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26447 invoked from network); 13 Mar 2005 17:18:23 -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 17:18:23 -0000 Received: (qmail 54681 invoked from network); 13 Mar 2005 17:18:13 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 13 Mar 2005 17:18:13 -0000 Received: (qmail 24453 invoked by alias); 13 Mar 2005 17:18:07 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8596 Received: (qmail 24440 invoked from network); 13 Mar 2005 17:18:06 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 13 Mar 2005 17:18:06 -0000 Received: (qmail 53848 invoked from network); 13 Mar 2005 17:18:06 -0000 Received: from vms044pub.verizon.net (206.46.252.44) by a.mx.sunsite.dk with SMTP; 13 Mar 2005 17:18:03 -0000 Received: from candle.brasslantern.com ([4.11.1.68]) by vms044.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0IDA006SWW20UMV0@vms044.mailsrvcs.net> for zsh-users@sunsite.dk; Sun, 13 Mar 2005 11:18:01 -0600 (CST) Received: from candle.brasslantern.com (IDENT:schaefer@localhost [127.0.0.1]) by candle.brasslantern.com (8.12.11/8.12.11) with ESMTP id j2DHGQlk018707 for ; Sun, 13 Mar 2005 09:16:26 -0800 Received: (from schaefer@localhost) by candle.brasslantern.com (8.12.11/8.12.11/Submit) id j2DHGQvC018706 for zsh-users@sunsite.dk; Sun, 13 Mar 2005 09:16:26 -0800 Date: Sun, 13 Mar 2005 17:16:26 +0000 From: Bart Schaefer Subject: Re: Why this expansion doesn't work? In-reply-to: <20050313093915.GA81@DervishD> To: Zsh Users Message-id: <1050313171626.ZM18705@candle.brasslantern.com> MIME-version: 1.0 X-Mailer: Z-Mail (5.0.0 30July97) Content-type: text/plain; charset=us-ascii References: <20050312101450.GA5656@DervishD> <1050312204940.ZM12046@candle.brasslantern.com> <20050313093915.GA81@DervishD> Comments: In reply to DervishD "Re: Why this expansion doesn't work?" (Mar 13, 10:39am) 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 On Mar 13, 10:39am, DervishD wrote: } } > 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. } > 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"\" } 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 (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. 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%