On 08/19/2013 07:54 PM, Eric Blake wrote: > On 08/19/2013 11:51 AM, Enda wrote: >> Say I type: >> >> $ echo cat $(ls -Qv *.pdf) > > Insufficient quoting. Try: > > $ echo cat "$(ls -Qv *.pdf)" > > and to really see the difference, first do > touch "two spaces.pdf" > in the directory. But even then, that only shows the input that you > want, but would still require an 'eval' to execute; and use of 'eval' in > shell on arbitrary file names is generally not worth the added danger. > > Why are you even bothering with ls, when the following is faster and > does what you want, without having to worry about awkward quoting in the > first place? > > cat *.pdf
http://www.pixelbeat.org/programming/shell_script_mistakes.html#globbing
