Michael (12023-04-05): > out of curiosity, why not omit xargs altogether and do someting like: > > #!/bin/bash > [...] > printf '%s\0' "$d"/* > done | > while read -r -d '' line; do > [...] > > or do i miss something?
1. Your script will execute the command once per argument, xargs will execute the command only once with all the arguments, or a few times as possible if the number of arguments is huge. 2. If you are relying on nonstandard shell constructs, then go directly for zsh and use recursive globbing and glob patterns. I do not understand how people can bear working with a shell without recursive globbing, glob patterns and temp file process substitution. My only conjecture is they do not know about it and never learned their marvels. Regards, -- Nicolas George