Path: csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: L A Walsh Newsgroups: gnu.bash.bug Subject: Re: Not missing, but very hard to see (was Re: Backslash missing in brace expansion) Date: Thu, 12 Dec 2019 18:57:53 -0800 Lines: 49 Approved: bug-bash@gnu.org Message-ID: References: <20191205201157.cd481936f76d95bbdfabc73c@schrader-schulte.de> <662e2328-f331-c554-afcf-fd3819f6beab@case.edu> <20191206055304.076d6115afa3a4f2a6a21c34@schrader-schulte.de> <5b5064a8-7175-42e7-1eb5-6374dee6c11e@redhat.com> <21761e28-c496-ff67-d7b7-628c9325085f@iki.fi> <9dd3a388-39b1-c059-de99-813f1e411764@case.edu> <5DF2987E.5000309@tlinx.org> <568aeaaa-22b3-c7b9-0e18-a92bef6d2ffb@iki.fi> <5DF2FE31.9070406@tlinx.org> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: usenet.stanford.edu 1576205886 12672 209.51.188.17 (13 Dec 2019 02:58:06 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash Envelope-to: bug-bash@gnu.org User-Agent: Thunderbird In-Reply-To: <568aeaaa-22b3-c7b9-0e18-a92bef6d2ffb@iki.fi> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 173.164.175.65 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <5DF2FE31.9070406@tlinx.org> X-Mailman-Original-References: <20191205201157.cd481936f76d95bbdfabc73c@schrader-schulte.de> <662e2328-f331-c554-afcf-fd3819f6beab@case.edu> <20191206055304.076d6115afa3a4f2a6a21c34@schrader-schulte.de> <5b5064a8-7175-42e7-1eb5-6374dee6c11e@redhat.com> <21761e28-c496-ff67-d7b7-628c9325085f@iki.fi> <9dd3a388-39b1-c059-de99-813f1e411764@case.edu> <5DF2987E.5000309@tlinx.org> <568aeaaa-22b3-c7b9-0e18-a92bef6d2ffb@iki.fi> Xref: csiph.com gnu.bash.bug:15724 On 2019/12/12 13:01, Ilkka Virta wrote: > On 12.12. 21:43, L A Walsh wrote: > >> On 2019/12/06 14:14, Chet Ramey wrote: >> >> Seems very hard to print out that backquote though. Closest I got >> was bash converting it to "''": >> > > The backquote is in [6], and the backslash disappears, you just get the > pair of quotes in [2] because that's how printf %q outputs an empty string. > ----- I'm sorry, but you are mistaken. The characters from 'Z' (0x5A) through 'z' (0x61) are: 0x5A 0x5B 0x5C 0x5D 0x5E 0x5F 0x60 0x61 Z [ \ ] ^ _ ` a the backslash comes between the two square brackets. Position [6] is the "Grave Accent" (or backquote). It is quoted properly. As for %q printing an empty string for 0x5C "%q" causes printf to output the corresponding argument in a format that can be reused as shell input. For that string to be empty would mean there is no character at hex value 0x5C (unicode U+005C), which isn't so. > >>> read -r -a a< <(printf "%q " {Z..a}) >>> my -p a >>> >> declare -a a=([0]="Z" [1]="\\[" [2]="''" [3]="\\]" [4]="\\^" [5]="_" >> [6]="\\\`" [7]="a") >> > > >