zsh-workers
 help / color / mirror / code / Atom feed
From: Stephane CHAZELAS <Stephane.CHAZELAS@free.fr>
To: zsh-workers@sunsite.dk
Subject: printf and POSIX compliance
Date: Tue, 4 Feb 2003 16:44:25 +0100	[thread overview]
Message-ID: <20030204164425.A192@pcchazelas.free.fr> (raw)

Hello all, and thank you for the very good job

I read at
http://www.opengroup.org/onlinepubs/007904975/utilities/printf.html
that, according to POSIX:

3- In addition to the escape sequences shown in the Base
   Definitions volume of IEEE Std 1003.1-2001, Chapter 5, File
   Format Notation ( '\\' , '\a' , '\b' , '\f' , '\n' , '\r' ,
   '\t' , '\v' ), "\ddd" , where ddd is a one, two, or
   three-digit octal number, shall be written as a byte with the
   numeric value specified by the octal number.

So

printf '\377\0377' | od -c

should return:
0000000 377 037   7
0000003

zsh printf gives:
0000000   \   3   7   7 377
0000005

zsh man pages says that sames sequences as for echo are
recognized. That's not what POSIX requires.

Note that neither bash nor GNU printf behave better.

The "printf '%b' '\0ooo'" is OK though.

--
Stéphane


             reply	other threads:[~2003-02-04 15:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-04 15:44 Stephane CHAZELAS [this message]
2003-02-04 18:26 ` DervishD
2003-02-05 13:10   ` Stephane CHAZELAS
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=20030204164425.A192@pcchazelas.free.fr \
    --to=stephane.chazelas@free.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).