> find . -depth -type d -empty -exec ls -ld {} \; -exec rmdir {} \;
> I want to replace this with xargs to speed it up.
Perhaps, not with xargs, but with sh:
find . -depth -type d -empty -exec sh -c '
ls -ld "$@";rmdir "$@"' sh {} +
--
printf -v email $(echo \ 155 141 162 143 145 154 142 162 165 151 \
156 163 155 141 100 171 141 150 157 157 056 143 157 155|tr \ \\\\)
# Live every life as if it were your last! #
You could as well do:
find . -depth -type d -empty -exec ls -ld {} + \
-exec rmdir {} +
And if your find has the non-standard -empty predicate, it also
probably has the -ls one.
The initial solution only calls rmdir if ls -ld succeeds,
so the equivalent using sh would be:
find . -depth -type d -empty -exec sh -c '
for i do
ls -ld "$i" && rmdir "$i"
done' sh {} +
(which is no speed up, unless your sh has ls or rmdir built in).
--
Stᅵphane