;compare files and report on differences
 ;12/2/2005 - for the Mac
 sf = getmatchedfiles('ana$','/Users/shine/ana/tools/',1000)
 nf = num_elem(sf)
 
 n_with_difs = 0
 n_nosuch_file = 0
 for i=0, nf-1 do {
  name = sf(i)
  ;;ty,'***************************************************************'
  ;;ty,'comparing ', name
  sq = 'diff -w /net/diapason/usr3/ANA/tools/ '+ name
  spawn, sq
  if !spawn eq 0 then ty,'no differences found' else {
        ;strip any path info from name
  	while (strpos(name,'/') ge 0) name=strskp(name,'/')
  	if !spawn eq 256 then {
	   if n_with_difs eq 0 then sdifs = [name] else sdifs = [sdifs,name]
	   n_with_difs += 1
	   }
  	if !spawn eq 512 then {
	   if n_nosuch_file eq 0 then smis = [name] else smis = [smis,name]
	   n_nosuch_file += 1
	   }
 }
 }
 ty,'***************************************************************'
 ty,'number of files with differences =', n_with_difs
 if n_with_difs then ty,'listing:\n', sdifs
 ty,'***************************************************************'
 ty,'number of files without a match on /usr3/ANA/ =', n_nosuch_file
 if n_nosuch_file then  ty,'listing:\n', smis
 ty,'***************************************************************'
 exit

