Re: Quoting, bacquotes, spaces and subshell: ls `echo '"my files"'`
- From: "Ed Morton" <mortonspam@xxxxxxxxx>
- Date: Fri, 13 Jul 2012 14:51:56 GMT
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
.
- Follow-Ups:
- Re: Quoting, bacquotes, spaces and subshell: ls `echo '"my files"'`
- From: Ben Bacarisse
- Re: Quoting, bacquotes, spaces and subshell: ls `echo '"my files"'`
- References:
- Prev by Date: Re: Quoting, bacquotes, spaces and subshell: ls `echo '"my files"'`
- Next by Date: Re: Quoting, bacquotes, spaces and subshell: ls `echo '"my files"'`
- Previous by thread: Re: Quoting, bacquotes, spaces and subshell: ls `echo '"my files"'`
- Next by thread: Re: Quoting, bacquotes, spaces and subshell: ls `echo '"my files"'`
- Index(es):
Relevant Pages
|