Path: csiph.com!news.mixmin.net!aioe.org!.POSTED!not-for-mail From: "Helmut Karlowski" Newsgroups: gnu.bash.bug Subject: Re: \c-handling in $'-strings Date: Wed, 02 Sep 2015 22:10:45 +0100 Organization: Aioe.org NNTP Server Lines: 41 Message-ID: References: NNTP-Posting-Host: KI55aZ7LNnCoM32DfYXE9Q.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.16 (Win32) X-Antivirus-Status: Clean X-Notice: Filtered by postfilter v. 0.8.2 X-Antivirus: avast! (VPS 150902-1, 02.09.2015), Outbound message Xref: csiph.com gnu.bash.bug:11472 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: >> >> 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. > > The Posix standardization of $'...' requires that the character after the Where is that described? I could not find anything about $'...' in the posix-docs. > `\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 of interest here. If that is true then the output of ksh93 for echo $'\c\d' |od -a -> 0000000 eot nl is wrong? It removes the \ every time. -Helmut