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

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: