coreutils
[Top][All Lists]
Advanced

[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



reply via email to

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