#!/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