我有一个file_in.txt
包含以下名称的文件 ( ):
aphid_splitseq.1.fasta.annot.xml
aphid_splitseq.2.fasta.annot.xml
aphid_splitseq.3.fasta.annot.xml
aphid_splitseq.4.fasta.annot.xml
aphid_splitseq.5.fasta.annot.xml
Run Code Online (Sandbox Code Playgroud)
我还有另一个文件 ( file_out.txt
) 具有以下名称:
aphid_splitseq_1
aphid_splitseq_2
aphid_splitseq_3
aphid_splitseq_4
aphid_splitseq_5
Run Code Online (Sandbox Code Playgroud)
现在我想要这样的陈述
java -cp *:ext/*: es.blast2go.prog.B2GAnnotPipe -in aphid_splitseq.1.fasta.annot.xml -out results/aphid_splitseq_1 -prop b2gPipe.properties -v -annot -dat
Run Code Online (Sandbox Code Playgroud)
基本上,我要循环通过每个的file_in.txt
和file_out.txt
并取代的值-in
和-out
用i
和j
分别。
我在 Bash 中尝试过,但它似乎不起作用:
aphid_splitseq.1.fasta.annot.xml
aphid_splitseq.2.fasta.annot.xml
aphid_splitseq.3.fasta.annot.xml
aphid_splitseq.4.fasta.annot.xml
aphid_splitseq.5.fasta.annot.xml
Run Code Online (Sandbox Code Playgroud)
paste
可能会有所帮助:
#!/bin/bash
paste file_in.txt file_out.txt | while read if of; do
echo "-in $if -out $of"
done
Run Code Online (Sandbox Code Playgroud)
产量:
-in aphid_splitseq.1.fasta.annot.xml -out aphid_splitseq_1
-in aphid_splitseq.2.fasta.annot.xml -out aphid_splitseq_2
-in aphid_splitseq.3.fasta.annot.xml -out aphid_splitseq_3
-in aphid_splitseq.4.fasta.annot.xml -out aphid_splitseq_4
-in aphid_splitseq.5.fasta.annot.xml -out aphid_splitseq_5
Run Code Online (Sandbox Code Playgroud)
您可以修改它以获得所需的行为。