我是bash脚本的初学者,有人可以帮我吗?
- 在目录 (
pamlfiles/
) 中,我有文件列表 (*.fa
)OG0018053.fa OG0018054.fa OG0018055.fa
- 文件如下所示:
head -n 2 ../pamlfiles/* ==> ../pamlfiles/OG0018053.fa <== >C.rhe ATGAGG------------GTCCTCCTGCTTCTCGGATTGGTGGCTTTTGGCCTGGCTGAC ==> ../pamlfiles/OG0018054.fa <== >L.fab atg---------------------acggacgagatatctctggcgtgtggcatgtcagga ==> ../pamlfiles/OG0018055.fa <== >A.ven ATGAACACTGCCACTCCCACCGAGTTTGACTTCTCTTTCTTGGAAGAGGGCTTCTCCGCC
- 我使用以下脚本 (
forloop.sh
) 处理它们:#!/bin/bash for file in ../pamlfiles/*.fa do filename=$(basename -- "$file") gene_name="${filename%%.*}" cp codeml_0_opt1_templ.ctl codeml_0.ctl sed -i -e "s/GENE/$gene_name/g" codeml_0.ctl codeml codeml_0.ctl done
但是,当我执行时forloop.sh
,我得到了错误
Sequence file ../pamlfiles/OG0018055 not found!
codem1_0_opt1_templ.ctl
看起来像这样:
head codeml_0_opt1_templ.ctl
seqfile = ../pamlfiles/GENE
outfile = results/GENE_M0.txt
treefile = OG0018055.fa.m.fa.mt.py.nex.treefile
noisy = 9
verbose = 0
runmode = 0
seqtype = 1
CodonFreq = 2
我哪里错了?