[Top][All Lists]

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

bash: echoing octal, disagreement between man page and behaviour

From: Giles Orr
Subject: bash: echoing octal, disagreement between man page and behaviour
Date: Sun, 26 Jul 2009 11:35:47 -0400


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.  The man page makes it
clear that for octal you use "\nnn", but this is clearly no longer the
case unless the leading character is a zero.  For years, three
characters of octal worked regardless of the value of the first
numeral: I know, I have several scripts running back years that use
this trick.

My current system is Debian Testing amd64 with kernel 2.6.26-1-amd64
and Bash version 3.2.48(1)-release on a quad core Intel Core 2.  I've
verified the same behaviour with Knoppix 6.0.1 i686 running on a
1.6GHz Centrino laptop with version 3.2.39(1)-release on a
i686 kernel.

If I can provide further details or have left out anything you need to
know, please ask.


reply via email to

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