Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > gnu.bash.bug > #16767

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

From Ilkka Virta <itvirta@gmail.com>
Newsgroups gnu.bash.bug
Subject Re: $(<...) fails with nested quoting.
Date 2020-08-17 16:12 +0300
Message-ID <mailman.42.1597674122.2469.bug-bash@gnu.org> (permalink)
References <09b3ac09-97ce-9bf2-fac3-e2d10113143d@gmail.com> <CAMLQOtRyVypby4P2HwY1pMsnV98yfJzomdp2KqC8y0N5ZFj9yg@mail.gmail.com>

Show all headers | View raw


On Mon, Aug 17, 2020 at 3:53 PM Steven McBride <zzymcbride@gmail.com> wrote:

>          'echo "$(<\"filename\")"' fails with No such file or directory
>

Quotes inside $() are independent from the ones outside. If you escape
them, you get literal quotes as part of the filename.

$ echo hello > '"filename"'
$ echo "$(<\"filename\")"
hello

$ echo another > 'name with spaces'
$ echo "$(<"name with spaces")"
another

I've been led to understand this isn't so with backticks, though.

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


Thread

Re: $(<...) fails with nested quoting. Ilkka Virta <itvirta@gmail.com> - 2020-08-17 16:12 +0300

csiph-web