Re: \c-handling in $'-strings

2015-09-03 Thread Chet Ramey
On 9/2/15 5:10 PM, Helmut Karlowski wrote: >> `\c' honor backslash escaping. Since the character becomes \c\\, the >> subsequent `c' and `]' are literals. > > I assume this is only true for "to-be-escaped" characters, that is > > $ ` " \ > > like for ".."-strings? Of course only \ is

Re: \c-handling in $'-strings

2015-09-02 Thread Eric Blake
On 09/02/2015 03:10 PM, Helmut Karlowski wrote: >> >> The Posix standardization of $'...' requires that the character after the > > Where is that described? I could not find anything about $'...' in the > posix-docs. http://austingroupbugs.net/view.php?id=249 It's not part of POSIX yet; but the

Re: \c-handling in $'-strings

2015-09-02 Thread Helmut Karlowski
Am 02.09.2015, 14:19 Uhr,SCHRIEB Chet Ramey : echo $'\c?' |od -a echo $'\c[\c\\c]\c^\c_\c?' |od -a bash prints: 000 us nl 002 000 esc fs c ] rs us us nl I'd expect: 000 del nl 002 000 esc fs gs rs us del nl Also the ] in the output seems wrong, looks

Re: \c-handling in $'-strings

2015-09-02 Thread Chet Ramey
On 9/1/15 6:46 PM, Helmut Karlowski wrote: > Do you refer to the table titled "Circumflex Control Characters in stty"? > > It states for example: > > ? Yeah, that's a problem. I've fixed that. > > Running: > > echo $'\c?' |od -a > echo $'\c[\c\\c]\c^\c_\c?' |od -a > > bash prints: > >

Re: \c-handling in $'-strings

2015-09-01 Thread Helmut Karlowski
Am 31.08.2015, 15:17 Uhr,SCHRIEB Chet Ramey : 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 t

Re: \c-handling in $'-strings

2015-08-31 Thread Chet Ramey
On 8/28/15 7:28 PM, Helmut Karlowski wrote: > Hello > > The bash-manual says: > > Words of the form $'string' are treated specially. The word expands to > string, with backslash-escaped characters replaced as specified by the > ANSI C standard. Backslash escape sequences, if present, are decod

\c-handling in $'-strings

2015-08-28 Thread Helmut Karlowski
Hello The bash-manual says: Words of the form $'string' are treated specially. The word expands to string, with backslash-escaped characters replaced as specified by the ANSI C standard. Backslash escape sequences, if present, are decoded as follows: ... \cxa control-x character