1 2 3 4 5 6 7 8 9 10 11
#!/bin/bash file=$(find . -name "*.[ch]" -o -name "*.cpp") for i in $file do echo $i astyle --style=linux -s4 -c -s -p -U -H -n $i sed -i 's/[ \t]*$//' $i #remove trailing space done