PREV INDEX NEXT

Author: Anonymous
Subject: -exec echo {} > foo
Date: Sunday, 06 Sep 2020, 01:50:52

When I run:

find -type f -print -exec echo {} > foo \;

I expect every file name to be printed on the command line AND written to the file 'foo'. However, what happens instead is that each file name is written twice to 'foo', and nothing is printed on the command line. Is this intended? Shouldn't only what is under -exec being piped to 'foo', and not the actual output of find?
PREV INDEX NEXT