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

Re: find



Johannes Franken wrote:

> On Sat, Feb 09, 2002 at 02:48:36PM -0200, Antonio Alberto Lobato wrote:
> >     # find /var/log -type f -exec echo -n > {} \;
> >     Why find create a file called "{}", instead to erase files contents
>
> That's proper behavior.
>
> The "> {}" goes to your shell (creating that file), so the arguments
> left for find are: "/var/log -type f -exec echo -n"
> (yet another implementation of the NOP command).
>
> Try
> echo >/tmp/blankfile && find /var/log -type f -exec cp /tmp/blankfile {} \;
> instead.

But the files permissions/owner/group would be changed.






Tom


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




Reply to: