#!/bin/bash


mkdir bzip
for name in *.mid;
  do
  for name2 in *.mid;
    do
    
    fn1=`basename "$name" .mid`
    fn2=`basename "$name2" .mid`
    
    if [ $name != $name2 ]; then
	cat $name $name2 > bzip/"$fn1""_""$fn2"".mid"
    fi
  done
done

mkdir compre

for name in *.mid;
  do
  bzip2 -k "$name"
  mv *.bz2 compre
done

cd compre
(ls -l *.bz2 | awk '{print $9 "   " $5}')  > ../t_fsize.txt
cd ../bzip

mkdir compre
for name in *.mid;
  do
  bzip2 -k "$name"
  mv *.bz2 compre
done

cd compre
(ls -l | awk '{print $9 "   " $5}')  > ../../u_fsize.txt
