From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25136 invoked by alias); 27 Sep 2011 18:17:53 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16451 Received: (qmail 16566 invoked from network); 27 Sep 2011 18:17:41 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at yahoo.fr does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.fr; s=s1024; t=1317147096; bh=/fFPkhZckyXDlozslB8ErfOfEAWB/ayQvPCHLFoXK9c=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Date:From:To:Cc:Subject:Message-ID:Mail-Followup-To:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent; b=oo5kCQCb8XUeWM8c/e+Hk6N2qXyYAN/DuoVQ9kvkR5l3luRcuUOpQ9hCBz5McI3gXxRVcdi921ZDOVDBcgy6T1eqX4D0WBLtihilbv6QWQRralR5jAqt12rKbbACvyGZdW/3OiThtYfJ+sliommHy0ammXWJKyTg6NVD73EztoI= X-Yahoo-Newman-Id: 514597.17866.bm@smtp131.mail.ukl.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: IAJA3RIVM1mGrJ3aZuMkHfhcPy5DJZPjLCViMdk9ExIR4F8 jCEAgXsN2lst_Nd47_QTF4uh5Z7f_4bTAqioRazd.kXTclNfb5baPj5FR371 ZRj7h_Bim91uAV0xyLDT_8DLZD6eQllWUyoT_qLUoHv5j_K2T3Jqnt_VZKNX xfWCYdag6I4VFMh2AYwPU1LOakhsjr1YzG8PyR1ENnOB7wltVqEPRxLh0iFW tEMohkMnOsljkAZ6ZIw0JLkQapU8Fqmy1.Fl3hLytFFTmoILHsm8UdFQmFQ9 jXWJx9dDHFKx2WvyRaoHifVMO2qmadZ0jrzvfR30OUdpDIv6jI6JdGFTjEXP RXM4zdJD1dsjDLHFx7xY83ejFAKcSC4GRv7O3g5uUamjyoP9xWQYd6xpiRO7 idyS_O.MbvwaLnqkhxnDDOjyEkRTo.zMZDqfs2RrtPRJEmQDIxQ7BEiGzh_5 9iXkgsRw4AvPCnqF5dCjwy8LdrhRA8li11FIvprox2TMM1DYr3eOawYuFJDc W X-Yahoo-SMTP: V1UR0WuswBDVD1eFhM33188Ir8ciBckz4W8ZMsAh Date: Tue, 27 Sep 2011 19:11:34 +0100 From: Stephane Chazelas To: Bart Schaefer Cc: Zsh Users , Ismail Donmez Subject: Re: Interesting zsh behaviour regarding awk and backslash Message-ID: <20110927181134.GA5502@yahoo.fr> Mail-Followup-To: Bart Schaefer , Zsh Users , Ismail Donmez References: <110927064822.ZM25007@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <110927064822.ZM25007@torch.brasslantern.com> User-Agent: Mutt/1.5.21 (2010-09-15) 2011-09-27 06:48:22 -0700, Bart Schaefer: > On Sep 27, 1:54pm, Jeremie Roquet wrote: > } > } Why bother with gawk? > } > } bash$ echo '\\' > } \\ > } zsh$ echo '\\' > } \ > > This isn't quoting behavior, it's "echo" behavior. If you tell zsh to > act like a standard shell, it does: > > % ARGV0=sh zsh -f > $ echo '\\' > \\ > $ set -o | grep echo > nobsdecho off > $ standard shells *are meant* to output "\", not "\\". bash is not standard in that regard. So zsh should *not* change its behavior when called as sh here. UNIX (POSIX+XSI) mandates the "\", POSIX makes the behavior of echo unspecified in that case ("\", "\\" and "ambiguous input" outputs are all acceptable, echo shouldn't be used in POSIX scripts where the arguments may contain "\" or start with "-n" (use printf instead)) zsh is not POSIX (and same for bash) in that it doesn't output "-e" when called as "echo -e". http://pubs.opengroup.org/onlinepubs/9699919799/utilities/echo.html for the spec. -- Stephane