bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Consume only up to 8 bit octal input for backslash-escaped chars (ec


From: Roman Rakus
Subject: Re: Consume only up to 8 bit octal input for backslash-escaped chars (echo, printf)
Date: Thu, 09 Dec 2010 09:53:52 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101027 Fedora/3.1.6-1.fc13 Lightning/1.0b3pre Thunderbird/3.1.6

On 12/08/2010 02:19 AM, Chet Ramey wrote:
On 12/7/10 11:12 AM, Roman Rakus wrote:
This one is already reported on coreutils:
http://debbugs.gnu.org/cgi/bugreport.cgi?msg=2;bug=7574

The problem is with numbers higher than /0377; echo and printf consumes all
3 numbers, but it is not 8-bit number. For example:
$ echo -e '\0610'; printf '\610 %b\n' '\610 \0610'
Should output:
10
10 10 10
instead of
�
� � �
No, it shouldn't.  This is a terrible idea.  All other shells I tested
behave as bash does*, bash behaves as Posix specifies, and the bash
behavior is how C character constants work.  Why would I change this?
Just wanted to work as coreutils. But ok, you can choose ;)
(*That is, consume up to three octal digits and mask off all but the lower
8 bits of the result.)
Yep. Nothing against this.
Chet

RR



reply via email to

[Prev in Thread] Current Thread [Next in Thread]