On 08/19/2013 08:54 PM, Eric Blake wrote: > On 08/19/2013 11:51 AM, Enda wrote:
>> $ echo cat $(ls -Qv *.pdf) > 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? Probably because of the -v sorting order ... so it's - once again - a little argument for a --null option. Otherwise, I'd suggest something like the following to avoid the `eval` problems: $ ls -1v *.pdf | xargs -d$'\n' cat And if there are even newline characters in the file names, then maybe this would be it: $ printf "%s\0" *.pdf | sort -zV | xargs -0 cat But as already mentioned, this is not a coreutils but rather a shell programming issue. Have a nice day, Berny
