Bug#279205: exim4-base: Correct with this
Marc Haber
Marc Haber <mh+debian-packages@zugschlus.de>, 279205@bugs.debian.org
Wed, 1 Dec 2004 10:00:05 +0100
On Sat, Nov 06, 2004 at 12:22:36PM +0100, Andreas Metzler wrote:
> What do you think about this one:
> if [ -x /usr/sbin/exim_tidydb ]; then
> cd /var/spool/exim4/db || exit 1
> find /var/spool/exim4/db -maxdepth 1 -name '*.lockfile' \
> -or -type f -printf '%f\n' | \
> while read file ; do
> exim_tidydb_as_mail /var/spool/exim4 "$file" >/dev/null
> done
> fi
>
> It is not perfect (like find ... -exec or find -print0 | xargs -0) but
> afaict that is not necessary.
But the xargs construction would be much less ugly
if [ -x /usr/sbin/exim_tidydb ]; then
cd /var/spool/exim4/db || exit 1
find /var/spool/exim4/db -maxdepth 1 -name '*.lockfile' \
-or -type f -print0 | \
xargs --null --max-args=1 exim_tidydb_as_mail /var/spool/exim4 >/dev/null
fi
I haven' actually tried in on a live system, but preliminary tests
look quite promising. However, using -exec would be even nicer, but
harder to read. That one is a matter of personal taste and quitung
skills.
Greetings
Marc