#!/bin/sh find . -mindepth 2 -name README.txt |sort |while read i; do d=`echo $i |sed s/README.txt//` echo "$d" echo -en "\t" head -q -n1 $i done > README.txt