Re: Quoting, bacquotes, spaces and subshell: ls `echo '"my files"'`



Karel <karel@xxxxxxxxxx> wrote:

This must be some kind of FAQ, but I just can't find it:

> ls `echo '"my files"'`
ls: "my: No such file or directory
ls: files": No such file or directory

Is there a way to declare a string in backquotes so that
it comes out properly quoted?

The problem is you're just not quoting the output of the echo:

$ > "my files"
$ ls "my files"
my files
$ ls "$(echo "my files")"
my files

Ed.

Posted using www.webuse.net
.



Relevant Pages