#!/bin/ksh
rm *.tmp
rm *.lst
for i in *.type3; do
echo $i >> name.tmp
gawk 'END {print NR}' $i >> nrow.tmp
done

paste name.tmp nrow.tmp > filename.tmp
gawk '{ if ( $2 < 1) print $1}' filename.tmp >> final.lst

for ii in $(cat final.lst) ;do
rm $ii
done

rm *.tmp
rm *.lst
for i in *.type4; do
echo $i >> name.tmp
gawk 'END {print NR}' $i >> nrow.tmp
done

paste name.tmp nrow.tmp > filename.tmp
gawk '{ if ( $2 < 1) print $1}' filename.tmp >> final.lst

for ii in $(cat final.lst) ;do
rm $ii
done


rm *.tmp
rm *.lst
for i in *.type2; do
echo $i >> name.tmp
gawk 'END {print NR}' $i >> nrow.tmp
done

paste name.tmp nrow.tmp > filename.tmp
gawk '{ if ( $2 < 1) print $1}' filename.tmp >> final.lst

for ii in $(cat final.lst) ;do
rm $ii
done

rm *.tmp
rm *.lst
for i in *.type1; do
echo $i >> name.tmp
gawk 'END {print NR}' $i >> nrow.tmp
done

paste name.tmp nrow.tmp > filename.tmp
gawk '{ if ( $2 < 1) print $1}' filename.tmp >> final.lst

for ii in $(cat final.lst) ;do
rm $ii
done
