Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #16764

Re: $(<...) fails with nested quoting.

From "" <kfm@plushkava.net>
Newsgroups gnu.bash.bug
Subject Re: $(<...) fails with nested quoting.
Date 2020-08-17 14:20 +0100
Message-ID <mailman.30.1597670459.2469.bug-bash@gnu.org> (permalink)
References <09b3ac09-97ce-9bf2-fac3-e2d10113143d@gmail.com> <30c6f199-581b-dc85-3ecb-7f085b5e8c60@plushkava.net>

Show all headers | View raw


On 17/08/2020 04:03, Steven McBride wrote:
> Configuration Information [Automatically generated, do not change]:
> Machine: x86_64
> OS: linux-gnu
> Compiler: gcc
> Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' 
> -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' 
> -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' 
> -DSHELL -DHAVE_CONFIG_H   -I.  -I../. -I.././include -I.././lib 
> -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 
> -fdebug-prefix-map=/build/bash-N2nMjo/bash-4.4.18=. 
> -fstack-protector-strong -Wformat -Werror=format-security -Wall 
> -Wno-parentheses -Wno-format-security
> uname output: Linux tau5vbub1 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 
> 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
> Machine Type: x86_64-pc-linux-gnu
> 
> Bash Version: 4.4
> Patch Level: 20
> Release Status: release
> 
> Description:
>          'echo "$(<\"filename\")"' fails with No such file or directory 
> error.
>      'echo "$(cat \"filename\")"'  also fails no such file or directory 
> error.
>      'echo "$(<filename)"' is okay.
>      'echo $(<"filename")' is okay.
>      I think I'm doing the nested double quoting correctly.

Only in the last case. There is no bug here.

>      The quoting is because in my original case 'filename' was
>      a variable that could contained a filename with spaces in it.

"$(<"$filename")"

For an explanation, see https://mywiki.wooledge.org/CommandSubstitution.

-- 
Kerin Millar

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: $(<...) fails with nested quoting. "" <kfm@plushkava.net> - 2020-08-17 14:20 +0100

csiph-web