find . -name file -exec echo abc > {} \; fail
应该改用:
find . -name file -exec bash -c 'echo abc > {}' \;
或者
for i in `find . -name file`
do
echo abc > $i
done
find . -name file -exec echo abc > {} \; fail
应该改用:
find . -name file -exec bash -c 'echo abc > {}' \;
或者
for i in `find . -name file`
do
echo abc > $i
done
转载于:https://my.oschina.net/u/191928/blog/618618