#!/bin/sh
# Autoindenter.
# This ugly trio of programs `do-indent', `indent1' and `wintounix' will
# indent all .c and .h files to a standard format.
# Author: Zoltan Kovacs <kovzol@math.u-szeged.hu>

which indent || exit 1
echo "You are to indent all .c and .h in this directory, recursively."
echo -n "Do you really want to do this? [n] "
read A
if [ "$A" = "y" ]; then
 gcc -o wintounix wintounix.c
 find .. -name '*.[ch]' -exec ./indent1 '{}' ';'
 fi
