DIRS="./*.cpp ./*.hpp ./kernels/*.cpp ./kernels/*.hpp ./attractors/*.stf" echo "This program will delete all trailing whitespaces and will replace spaces with tabs" for file in ${DIRS} do echo "yay ${file}" unexpand -t 4 ${file} | sed 's/[ \t]*$//' > ${file}.new cat ${file}.new > ${file} rm ${file}.new done