#!/bin/csh
#
#This program removes the extraneous garbage from files transferred
#using mcopy. In particular ^M and lines with ^Z are removed.
#
rm -f errlog
foreach i ($argv[*])
	echo $i
	echo $i >>errlog
	/usr/ucb/ex - $i  << "ENDOFEDIT" >> errlog
		%s///
		g/^*$/d
		%s///
		w!
		q
"ENDOFEDIT"
end
