Possible Duplicate:Executing user defined function in a find -exec call Suppose I have the following bash code:!#/bin/bashfunction  print_echo (){    echo This is print_echo Function $1;}find ./ -iname * -exec print_echo {} \;For each -exec command i get the following error:find: `print_echo': No such file or directoryNOTE: Before it , i tested it for a critical program , and solved my program with another algorithm but it's a question: Why find command doesn't accept built-in bash command and function name as argument of -exec?
Find functions, commands, and builtins
bash;shell;find;function
The find does not accept your function as a command because its -exec predicate literally calls C library exec function to start the program. Your function is available only to the bash interpreter itself. Even if you define your function inside your .bashrc file it will be 'visible' only to the bash.So, if you really need two execute with find's -exec some custom sequence of commands  put it into a separate script file or use other workarounds.