zsh-workers
 help / color / mirror / code / Atom feed
From: Stephane CHAZELAS <Stephane_CHAZELAS@yahoo.fr>
To: zsh-workers@sunsite.dk
Subject: Re: printf and POSIX compliance
Date: Wed, 5 Feb 2003 14:10:11 +0100	[thread overview]
Message-ID: <20030205141011.A705@pcchazelas.free.fr> (raw)
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  <opk@zsh.org>

        * 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


  reply	other threads:[~2003-02-05 13:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-04 15:44 Stephane CHAZELAS
2003-02-04 18:26 ` DervishD
2003-02-05 13:10   ` Stephane CHAZELAS [this message]
2003-02-05 13:42     ` Peter Stephenson
2003-02-11 12:09       ` PATCH: unset -v (was Re: printf and POSIX compliance) Oliver Kiddle
2003-02-05 14:41     ` printf and POSIX compliance DervishD
2003-02-11  8:29 ` Oliver Kiddle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030205141011.A705@pcchazelas.free.fr \
    --to=stephane_chazelas@yahoo.fr \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).