#! /bin/sh for file in `find . -name '*.orig'` do realname=`basename $file .orig` diff -u `dirname $file`/$realname{.orig,} done