From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1272 invoked from network); 5 Feb 2003 13:12:17 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 5 Feb 2003 13:12:17 -0000 Received: (qmail 23738 invoked by alias); 5 Feb 2003 13:12:07 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18197 Received: (qmail 23731 invoked from network); 5 Feb 2003 13:12:06 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 5 Feb 2003 13:12:06 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [213.228.0.169] by sunsite.dk (MessageWall 1.0.8) with SMTP; 5 Feb 2003 13:12:4 -0000 Received: from pcchazelas.free.fr (grenoble-2-a7-62-147-188-230.dial.proxad.net [62.147.188.230]) by postfix3-2.free.fr (Postfix) with ESMTP id 36B67C0B1 for ; Wed, 5 Feb 2003 14:12:06 +0100 (CET) Received: (from chazelas@localhost) by pcchazelas.free.fr (8.9.3/8.9.3) id OAA00779 for zsh-workers@sunsite.dk; Wed, 5 Feb 2003 14:10:12 +0100 Date: Wed, 5 Feb 2003 14:10:11 +0100 From: Stephane CHAZELAS To: zsh-workers@sunsite.dk Subject: Re: printf and POSIX compliance Message-ID: <20030205141011.A705@pcchazelas.free.fr> Mail-Followup-To: zsh-workers@sunsite.dk References: <20030204164425.A192@pcchazelas.free.fr> <20030204182611.GE18261@DervishD> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.3.14i In-Reply-To: <20030204182611.GE18261@DervishD>; from raul@pleyades.net on Tue, Feb 04, 2003 at 07:26:11PM +0100 On Tue, Feb 04, 2003 at 07:26:11PM +0100, DervishD wrote: > > http://www.opengroup.org/onlinepubs/007904975/utilities/printf.html > > that, according to POSIX: > > That is Single Unix Specification, not POSIX, am I wrong? I must confess I've not understood all of this imbroglio of obscure specifications, but had the rough idea this SUS was a step forward after POSIX. Well, it's also an IEEE (or maybe Open Group registered at IEEE???) document and it's publicly available. > > 3- In addition to the escape sequences shown in the Base > > Oh, additional sequences, not POSIX ones. Ok, then :) No, you misunderstood that point. Read at: http://www.opengroup.org/onlinepubs/007904975/utilities/printf.html These are additional sequences over those defined at: http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap05.html > > Note that neither bash nor GNU printf behave better. > [...] > BTW, as far as I know, zsh has not a printf builtin. I was actually speaking of printf builtin in zsh developpement series (4.1.1-dev-x), aka "print -f" zsh ChangeLog: 2001-10-05 Oliver Kiddle * 15851, 15948: Src/builtin.c, Doc/Zsh/builtins.yo: add printf builtin with basic POSIX functionality Actually, the only portable (as far as I know) way to display my first name with any printf (and ascii chars only) is: printf '%b' 'St\0351phane' printf 'St\351phane' will break GNU and zsh ones (not bash) printf 'St\0351phane' will break POSIX (or whatever standard is used in recent unices) ones (such as HPUX's one) (not bash, GNU nor zsh). I don't know about ksh93's one. So, that doesn't really matter if zsh printf adopts one syntax or another, but it may be wise to pick the one that is more likely to eventually become standard one day. Maybe the bash behavior (\351 and \0351 both expanding to é) is the least worst... -- Stéphane