[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bash: echoing octal, disagreement between man page and behaviour
From: |
Chet Ramey |
Subject: |
Re: bash: echoing octal, disagreement between man page and behaviour |
Date: |
Sun, 26 Jul 2009 14:08:43 -0400 |
User-agent: |
Thunderbird 2.0.0.22 (Macintosh/20090605) |
Giles Orr wrote:
> Hello.
>
> Not sure if this a bug or a documentation problem: it's certainly a
> change from previous behaviour, and a disagreement between current
> behaviour and the documentation.
>
> The man page says that:
>
> $ echo -e "\173"
>
> should produce a "{" but instead it produces a "\173". Since
>
> $ echo -e "\073"
>
> acts as behaved, producing a ";", I wondered if perhaps this would work:
>
> $ echo -e "\0173"
>
> and it does, giving the expected opening brace.
I'm not sure which man page you're looking at, but the one shipped with
bash-3.2.48 includes the following in the description of "echo":
\0nnn the eight-bit character whose value is the octal value
nnn (zero to three octal digits)
I think that makes it pretty clear that the leading 0 is not optional.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/