Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #15724 > unrolled thread
| Started by | L A Walsh <bash@tlinx.org> |
|---|---|
| First post | 2019-12-12 18:57 -0800 |
| Last post | 2019-12-12 18:57 -0800 |
| Articles | 1 — 1 participant |
Back to article view | Back to gnu.bash.bug
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Not missing, but very hard to see (was Re: Backslash missing in brace expansion) L A Walsh <bash@tlinx.org> - 2019-12-12 18:57 -0800
| From | L A Walsh <bash@tlinx.org> |
|---|---|
| Date | 2019-12-12 18:57 -0800 |
| Subject | Re: Not missing, but very hard to see (was Re: Backslash missing in brace expansion) |
| Message-ID | <mailman.766.1576205886.1979.bug-bash@gnu.org> |
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")
>>
>
>
>
Back to top | Article view | gnu.bash.bug
csiph-web