summaryrefslogtreecommitdiffstats
path: root/reindent
blob: 9237ae202cdc2dcb7518fb1ebca665f54a0cd8f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/bash

if [[ $# < 3 ]]; then
	echo "usage: reindent <from space count> <to space count> <file> ..."
	exit 1
fi

from=$1; shift
to=$1; shift

for file in "$@"; do
	unexpand -t "$from" "$file" | expand -i -t "$to" | sponge "$file"
done