#!/bin/bash PERLTIDY='/usr/local/bin/perltidy -l 123 ' TOUCH=/bin/touch DIFF=/usr/bin/diff WC=/usr/bin/wc CP=/bin/cp if [ $# -gt 0 ] then echo Command line: $0 $@ for file in $@ do if [ ! -e $file.tdy ] then $TOUCH $file.tdy fi if [ `$DIFF -q $file $file.tdy | $WC -l` -gt 0 ] then $PERLTIDY $file if [ -e $file.ERR ] then echo Error detected-not replacing else $CP -v $file.tdy $file fi else echo Skipping $file - perltidy on file not necessary fi done else echo Usage: $0 filename fi