#Using single-purpose GNU programs
###GNU Expand
The expand utility works (only) as a pipeline program:
for f in "${sources[@]}"
do
cp "$f" "$f.bak" && expand <"$f.bak" >"$f"
done
###GNU Indent
The indent utility can completely re-layout your code. The option to expand tabs is -nut:
indent -nut "${sources[@]}"