#!/bin/bash if [[ $# < 3 ]]; then echo "usage: reindent ..." exit 1 fi from=$1; shift to=$1; shift for file in "$@"; do unexpand -t "$from" "$file" | expand -i -t "$to" | sponge "$file" done