find . -type f|xargs シェル関数 みたいなことをしたいときにはexport -f シェル関数しておけば良い。bashなら、
$ test_func() { echo $1; }
$ export -f test_func
$ echo aaa | xargs -I{} bash -c "test_func {}"
aaa
という感じで、シェル関数をexportできる。
Challange IT For Future
find . -type f|xargs シェル関数 みたいなことをしたいときにはexport -f シェル関数しておけば良い。bashなら、
$ test_func() { echo $1; }
$ export -f test_func
$ echo aaa | xargs -I{} bash -c "test_func {}"
aaa
という感じで、シェル関数をexportできる。