#!/bin/tcsh
#
# fr - Find and Replace using sed
#
#
if( $#argv < 3 ) then
echo $0:t 'findexp replaceexp "filespec"'
exit 0
endif

echo $1
set sexpr = s/"$1"/"$2"/
echo $sexpr

foreach file( $3 )
	echo $file
	mv $file $file.tmp
	sed "$sexpr" $file.tmp > $file
	rm $file.tmp
end
