bug-bash
[Top][All Lists]
Advanced

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

Re: \c-handling in $'-strings


From: Helmut Karlowski
Subject: Re: \c-handling in $'-strings
Date: Tue, 01 Sep 2015 23:46:28 +0100
User-agent: Opera Mail/12.16 (Win32)

Am 31.08.2015, 15:17 Uhr,SCHRIEB Chet Ramey <chet.ramey@case.edu>:

Conversion to a control character is effected by ANDing with 0x1f, since
the valid control character range is 0-0x1f. If you have something that's
not a valid control character after being ANDed with 0x1f, you get
undefined results.

There is a table in

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/stty.html#tag_20_123

Do you refer to the table titled "Circumflex Control Characters in stty"?

It states for example:

?       <DEL>

Running:

echo $'\c?' |od -a
echo $'\c[\c\\c]\c^\c_\c?' |od -a

bash prints:

0000000  us  nl
0000002
0000000 esc  fs   c   ]  rs  us  us  nl

I'd expect:

0000000 del  nl
0000002
0000000 esc  fs  gs  rs  us del  nl

Also the ] in the output seems wrong, looks it gets the \\ wrong, though ksh93 does this also.

Not a serious issue ...

-Helmut


reply via email to

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