Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: printf %b



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 <NL>3
printf %b '\123' should output \123 (I think).

Cheers,
Stéphane



Messages sorted by: Reverse Date, Date, Thread, Author