[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Simple use of HOME with ${} instead of single $ sometimes doen't wor
From: |
Etienne Lorrain |
Subject: |
Re: Simple use of HOME with ${} instead of single $ sometimes doen't work... Ubuntu 22.04.3 LTS |
Date: |
Fri, 20 Oct 2023 14:54:12 +0000 (UTC) |
Thanks Kerin for pointing that out, fast cut&paste with mouse (right mouse
button select, middle button paste) in between terminals is fully preserving
those chars on latest Ubuntu...
etienne@etienne-7950x:~$ cat | hexdump -xc
echo ${HOME}:/home/${USER}
0000000 6365 6f68 2420 e27b 8b80 80e2 e28b 8b80
0000000 e c h o $ { 342 200 213 342 200 213 342 200 213
0000010 80e2 e28b 8b80 80e2 e28b 8b80 4f48 454d
0000010 342 200 213 342 200 213 342 200 213 342 200 213 H O M E
0000020 e27d 8b80 80e2 e28b 8b80 80e2 e28b 8b80
0000020 } 342 200 213 342 200 213 342 200 213 342 200 213 342 200 213
0000030 80e2 e28b 8b80 2f3a 6f68 656d 242f e27b
0000030 342 200 213 342 200 213 : / h o m e / $ { 342
0000040 8b80 80e2 e28b 8b80 80e2 e28b 8b80 80e2
0000040 200 213 342 200 213 342 200 213 342 200 213 342 200 213 342 200
0000050 e28b 8b80 5355 5245 e27d 8b80 80e2 e28b
0000050 213 342 200 213 U S E R } 342 200 213 342 200 213 342
For Info, the source of those characters comes from a WEB page generated by
"Confluence" WEB page displayed by Firefox:
Culpit: Confluence: A Brief Overview | Atlassian
The standard way to get rid of such chars I used is to paste that on the text
editor, then cut the text again. That way also preserve the chars...
Regards,Etienne.
-------------------------- Le vendredi 20 octobre 2023 à 14:23:25 UTC+1,
Kerin Millar <kfm@plushkava.net> a écrit :
On Fri, 20 Oct 2023 09:41:26 +0000 (UTC)
Etienne Lorrain via Bug reports for the GNU Bourne Again SHell
<bug-bash@gnu.org> wrote:
> Configuration Information [Automatically generated, do not change]:
> Machine: x86_64
> OS: linux-gnu
> Compiler: gcc
> Compilation CFLAGS: -g -O2 -flto=auto -ffat-lto-objects -flto=auto
> -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security
> -Wall
> uname output: Linux etienne-7950x 6.2.0-34-generic #34~22.04.1-Ubuntu SMP
> PREEMPT_DYNAMIC Thu Sep 7 13:12:03 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
> Machine Type: x86_64-pc-linux-gnu
>
> Bash Version: 5.1
> Patch Level: 16
> Release Status: release
>
> Description:
> simple unmodified cut&paste of a session:
>
> etienne@etienne-7950x:~$ /bin/bash --version
> GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)
> Copyright (C) 2020 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
>
> This is free software; you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> etienne@etienne-7950x:~$ /bin/bash
> etienne@etienne-7950x:~$ echo
> ${HOME}:/home/${USER}
> bash: ${HOME}:/home/${USER}: bad substitution
> etienne@etienne-7950x:~$ echo ${HOME}
> bash: ${HOME}: bad substitution
The above commands are chock full of ZERO-WIDTH SPACE characters, encoded as
UTF-8.
00000000 65 63 68 6f 20 24 7b e2 80 8b e2 80 8b e2 80 8b |echo ${.........|
00000010 e2 80 8b e2 80 8b e2 80 8b e2 80 8b 48 4f 4d 45 |............HOME|
00000020 7d e2 80 8b e2 80 8b e2 80 8b e2 80 8b e2 80 8b |}...............|
00000030 e2 80 8b e2 80 8b 0a |.......|
00000037
Bash prints these non-printing characters within the diagnostic message exactly
as they are, making the fact harder to diagnose. Nevertheless, it is quite
correct in pointing out that it is a bad substitution.
--
Kerin Millar