bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Ilkka Virta
Subject: Re: $(<...) fails with nested quoting.
Date: Mon, 17 Aug 2020 16:12:10 +0300

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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]