[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
process the output of $() with files with spaces
From: |
Enda |
Subject: |
process the output of $() with files with spaces |
Date: |
Mon, 19 Aug 2013 10:51:14 -0700 (PDT) |
Say I type:
$ echo cat $(ls -Qv *.pdf)
cat "file 1.pdf" "file 2.pdf"
The output above is what I want to execute. However the following command fails.
$ cat $(ls -Qv *.pdf)
cat: "file: No such file or directory
cat: 1.pdf": No such file or directory
cat: "file: No such file or directory
cat: 2.pdf": No such file or directory
The output here is also what I want but fails without the echo:
echo cat $(ls --quoting-style=escape -v *.pdf)
How do I get around this problem?
Many thanks,
Enda
- process the output of $() with files with spaces,
Enda <=