This is just a guess, but "> file" is really a shell built-in. When find uses the
-exec command it will try to fork and exec a program. But "> file" isn't an
executable. You may be stuck with the cp - executing a shell just to use the
redirection is probably worse than cp. If you're obsessed with speed there may be
a faster executable out there. So, I think you're stuck, but at least you know
why.
> "> file" is better than "cp /dev/null file"
> because it does not fork another process.
> So I should do
> find file -exec > {} \;
> instead
> find file -exec cp /dev/null {} \;
> right?
> But it does not do what I want it to do. I even tried
> find file -exec \> {} \;
> what is the story? Thank you.
> --
> unix programs: niftp (non-interactive recursive ftp), hide (hide command args),
> submit (replace nohup), etc from ftp://ftp.mindspring.com/users/mwang/unix-prog
--
Allen Kirby
AT&T Information Technology Services
Alpharetta, GA.
The views expressed here are mine, not my employers.