From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16068 invoked from network); 4 Jan 2007 16:32:59 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.7 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 4 Jan 2007 16:32:59 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 33826 invoked from network); 4 Jan 2007 16:32:53 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 4 Jan 2007 16:32:53 -0000 Received: (qmail 7393 invoked by alias); 4 Jan 2007 16:32:48 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23087 Received: (qmail 7376 invoked from network); 4 Jan 2007 16:32:47 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 4 Jan 2007 16:32:47 -0000 Received: (qmail 33064 invoked from network); 4 Jan 2007 16:32:47 -0000 Received: from unknown (HELO n066.sc1.he.tucows.com) (64.97.136.159) by a.mx.sunsite.dk with SMTP; 4 Jan 2007 16:32:41 -0000 Received: from sc (82.26.160.127) by n066.sc1.he.tucows.com (7.2.069.1) id 45533FFA0041D84E for zsh-workers@sunsite.dk; Thu, 4 Jan 2007 16:32:06 +0000 Received: from chazelas by sc with local (Exim 3.36 #1 (Debian)) id 1H2VVZ-0002Ug-00 for ; Thu, 04 Jan 2007 16:32:01 +0000 Date: Thu, 4 Jan 2007 16:32:00 +0000 From: Stephane Chazelas To: Zsh hackers list Subject: Re: printf %b Message-ID: <20070104163200.GA4883@sc> Mail-Followup-To: Zsh hackers list References: <20061227145818.GA4369@sc> <20070104153612.7aeb604f.pws@csr.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20070104153612.7aeb604f.pws@csr.com> User-Agent: Mutt/1.5.6i Sender: Stephane Chazelas On Thu, Jan 04, 2007 at 03:36:12PM +0000, Peter Stephenson wrote: [...] > - \0NNN works for "echo" (OK) > - printf's arguments are like echo (OK, need \0NNN. > However, Stephane... this means that > printf '\123' > *doesn't* print S any more, it needs '\0123', too; that's changed > back with the fix below.) > - print without options is the same as echo except for some additions > (\C-..., \M-..., \E) (WRONG: \0NNN doesn't work but \NNN does) > - \NNN works for bindkey sequences (and hence for "print -b") > (OK). > > The same goes for \0xNN and \xNN. [...] Hi Peter, POSIX says printf '\123' and printf %b '\0123' should output "S" (note that the two syntaxes are different!) and printf '\0123' should output 3 printf %b '\123' should output \123 (I think). Cheers, Stéphane