#!/bin/bash
tr -d '[:blank:]' < list.txt > outputFile.tmp
for i in $(cat outputFile.tmp)
do
echo "seqfile = ${i}_p.phy" >> ${i}_M0.ctl
echo "treefile = constant.txt" >> ${i}_M0.ctl
echo "outfile = ${i}_M0_mlc" >> ${i}_M0.ctl
done
exit 0
Пояснение:
tr -d '[:blank:]' < list.txt > outputFile.tmp
удалит пробелы из списка и скопирует его вoutputFile.tmp
for
считывает все строки из outputFile.tmp
и добавляет в файлы необходимый контекст, создавая их на лету.