Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug#386730: zsh: printf doesn't handle single-digit and two-digit octal escapes
- X-seq: zsh-workers 22682
- From: Clint Adams <schizo@xxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: Bug#386730: zsh: printf doesn't handle single-digit and two-digit octal escapes
- Date: Sat, 9 Sep 2006 16:52:34 -0400
- Cc: Hrvoje Niksic <hniksic@xxxxxxxxxx>, 386730-forwarded@xxxxxxxxxxxxxxx
- In-reply-to: <20060909190321.4014.89342.reportbug@mulj>
- Mail-followup-to: zsh-workers@xxxxxxxxxx,	Hrvoje Niksic <hniksic@xxxxxxxxxx>,	386730-forwarded@xxxxxxxxxxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20060909190321.4014.89342.reportbug@mulj>
Will changing getkeystring() break anything?
> zsh's builtin printf fails to interpret two-digit octal escape, such as '\1'
> or '\33'.  For example:
> 
> zsh% printf '\33abc' | hd
> 00000000  5c 33 33 61 62 63                                 |\33abc|
> 00000006
> 
> On the other hand, the printf from textutils handles them:
> 
> $ /usr/bin/printf '\33abc' | hd
> 00000000  1b 61 62 63                                       |.abc|
> 00000004
> 
> The zshbuiltins man page promises "formatting rules are the same as used in
> C", and C explicitly supports single-digit and double-digit octal escapes in
> string and character literals -- see section "6.4.4.4 Character constants"
> of the C99 standard.
> 
> Furthermore, POSIX explicitly states that \d and \dd are supported by
> printf(1) -- see http://tinyurl.com/gkdfr/, extended description, item 3. 
> The Solaris printf(1), the bash printf builtin, and the FreeBSD printf(1)
> all support them.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author