[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[jfranken@jfranken.de: Re: find]



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 <jfranken@jfranken.de> -----
Date: Sat, 9 Feb 2002 21:58:19 +0100
From: Johannes Franken <jfranken@jfranken.de>
To: Antonio Alberto Lobato <tomlobato@yahoo.com>
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:jfranken@jfranken.de
http://www.jfranken.de/



Reply to: