From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 744 invoked from network); 12 Mar 2005 10:13:38 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 12 Mar 2005 10:13:38 -0000 Received: (qmail 66195 invoked from network); 12 Mar 2005 10:13:32 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 12 Mar 2005 10:13:32 -0000 Received: (qmail 5433 invoked by alias); 12 Mar 2005 10:13:22 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8586 Received: (qmail 5418 invoked from network); 12 Mar 2005 10:13:21 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 12 Mar 2005 10:13:21 -0000 Received: (qmail 64839 invoked from network); 12 Mar 2005 10:13:21 -0000 Received: from ns9.hostinglmi.net (213.194.149.146) by a.mx.sunsite.dk with SMTP; 12 Mar 2005 10:13:16 -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 1DA3cO-0003f5-G8 for zsh-users@sunsite.dk; Sat, 12 Mar 2005 11:13:12 +0100 Date: Sat, 12 Mar 2005 11:14:50 +0100 From: DervishD To: Zsh Users Subject: Why this doesn't work? Message-ID: <20050312101450.GA5656@DervishD> Mail-Followup-To: Zsh Users Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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 all :)) I have a problem with quoting and 'eval'. I know that, withing double quotes, the '\' is a quoting char only if followed by '\','$', '"', ''' and newline, otherwise is a literal backslash. This allow for this: $ printf -- "Hello\n" Hello In that expression, the '\' is a literal '\', no problem. The problema arises when: $ eval printf -- "Hello\\n" Hello$ $ eval printf -- "Hello\\\n" Hello I mean, no newline character is output when using just two backslashes, and I don't understand that. In the first case, with two backslashes, I think that the shell interprets it as 'Hello' plus '\\' (that is, a backslash) and a 'n', so the shell runs a command like: 'printf -- "Hello\n"'. Obviously, it doesn't. The second example, as I understand it, should expand to: printf -- "Hello\\n" that is, "Hello" plus "\\" plus "\n". If the double-quotes rule is not followed in 'eval' commands, it should expand to "Hello" plus "\\" resulting in one "\" and "\n" resulting in "n", but then in the example with just two backslashes it should expand to "Hello" plus "\\" resulting in "\" and a "n", that is, the same. And obviously is not. What am I missing? I always use three backslases in 'eval' commands because sometime in the past I learned why, but I've forgotten, sorry O:))) Anyone could help? Thanks a lot in advance :) 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...