Skip to main content
Source Link
Toby Speight
  • 88.7k
  • 16
  • 34

#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[@]}"
Post Made Community Wiki by Toby Speight