cd $1 for i in * do sed -n " /SH *NAM/,/SH/{ /SH/d s/ *.-.*// s/, */\\ /g s/\\n\\n/\\ /g s/\\n/ $i&/g s/\$/ $i/ p } /SH *DES/q " $i done |sort -u