In my bashrc:
...
foo(){
echo "foo";
}
export -f foo
...
and when I try to call that function from find -exec:
$ find . -exec sh -c 'cd "$1"; foo' sh {} \;
I got
sh: 1: foo: not found
sh: 1: foo: not found
sh: 1: foo: not found
so how to make the find command see the exported function?