#!/bin/bash PWD=`pwd` TOP=`basename $PWD` if [ -f $1~ ]; then rm -f $1~ fi cp $1 $1~ $EDITOR $1 cd .. diff -up $TOP/$1~ $TOP/$1 >>$TOP/current.diff find . -maxdepth 1 -name current.diff -empty -exec rm {} \;