#!/bin/sh

tname=1

for name1 in *.txt;
  do
  for name2 in *.txt;
    do
    if [ $name1 != $name2 ]; then
        cat "$name1" "$name2" >> $tname
        echo "$tname" ":" "$name1" "$name2">> list.out
        tname=`expr $tname + 1`
    fi
  done
done