x=$(find . -name \"*.txt\") echo $x
if I run the above piece of code in Bash shell, what I get is a string containing several file names separated
(Updated to include @Socowi's execellent speed improvement)
With any $SHELL that supports it (dash/zsh/bash...):
$SHELL
find . -name "*.txt" -exec $SHELL -c ' for i in "$@" ; do echo "$i" done ' {} +
Done.
Original answer (shorter, but slower):
find . -name "*.txt" -exec $SHELL -c ' echo "$0" ' {} \;