Tom,

sorry for the typo. should be
        echo echo -n \> \$1 > /tmp/truncate &&
        find /var/log -type f -exec sh /tmp/truncate {} \;

another way to do it would be
        find /var/log -type -f -exec cp /dev/null {} \;

HTH
----- Forwarded message from Johannes Franken <[EMAIL PROTECTED]> -----
Date: Sat, 9 Feb 2002 21:58:19 +0100
From: Johannes Franken <[EMAIL PROTECTED]>
To: Antonio Alberto Lobato <[EMAIL PROTECTED]>
Cc: debian-user@lists.debian.org
Subject: Re: find

> > >     # find /var/log -type f -exec echo -n > {} \;
> > >     Why find create a file called "{}", instead to erase files contents
> > Try find /var/log -type f -exec cp /tmp/blankfile {} \;
> But the files permissions/owner/group would be changed.

You're right. What about
echo echo -n \> \$1 /tmp/truncate &&
find /var/log -type f -exec sh /tmp/truncate {} \;

-- 
Johannes Franken
 
Professional unix/network development
mailto:[EMAIL PROTECTED]
http://www.jfranken.de/

Reply via email to