为了方便格式化所有代码,写的脚本:
function format(){ echo "*********format codes tool************" find . -name *.cpp | xargs astyle --style=linux --indent=spaces=4 find . -name *.h | xargs astyle --style=linux --indent=spaces=4 find . -name *.inl | xargs astyle --style=linux --indent=spaces=4 find . -name *.hpp | xargs astyle --style=linux --indent=spaces=4 echo "*********format codes finish**********" } function clean(){ find . -name *.orig | xargs rm -f } case "$1" in "format") format ;; "clean") clean ;; *) format clean esac