On 06/04/2015 02:59 PM, Eric Blake wrote: >>> +good: >>> + @@list='$(list)'; for arg in $$list; do echo $$arg; done >> [...] >> >> Another option is to use: >> >> for arg in $${-+$(list)}; do echo $$arg; done > Furthermore, your suggestion mishandles a list with a bare }, whereas > mine does not. "make good list='} a'" should output $'}\na\n', not $'a}\n'. Of course, your version has the benefit of preserving a list that contains shell quoting (such as list = "a b" intended to produce a single string $'a b') while mine eats it early (producing $'"a' and $'b"'). But remember that my example is written in a context of makefiles, where makefile variables tend to be designed to be split at all whitespace boundaries and do not have an easy mechanism for handling text that must have specific embedded spacing, and as such are unlikely to require shell quoting in the first place. Once again going to show that you have to think about each particular problem in context (what sort of input will it be processing), rather than blindly assuming that one formulation will be a catch-all solution. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org