zsh-workers
 help / color / mirror / code / Atom feed
* printf and POSIX compliance
@ 2003-02-04 15:44 Stephane CHAZELAS
  2003-02-04 18:26 ` DervishD
  2003-02-11  8:29 ` Oliver Kiddle
  0 siblings, 2 replies; 7+ messages in thread
From: Stephane CHAZELAS @ 2003-02-04 15:44 UTC (permalink / raw)
  To: zsh-workers

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-02-11 12:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-04 15:44 printf and POSIX compliance Stephane CHAZELAS
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

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).