Very beginner in bash, already I wrote a small script looping through all the *.txt files and processing the *.txt as an input to a perl script.
Single file as an input
#!/bin/bash
set -e
for i in *.txt
do
SAMPLE=$(echo ${i} | sed "s/.txt//")
echo ${SAMPLE}.txt
time /home/sunn/data/softwares/evaluation/msa/pal2nal.v14/pal2nal.pl ${SAMPLE}.txt -output paml > ${SAMPLE}.paml.txt
done
Actual command for running perl script (2 files as input)
pal2nal.pl OG0012884_out.fa OG0012884_out.txt -output paml > OG0012884_paml.txt
Two files as a input ? I got struck..
#!/bin/bash
set -e
for i in *.txt
do
SAMPLE=$(echo ${i} | sed "s/.txt//" | "s/.fa//")
echo ${SAMPLE}.txt
time /home/sunn/data/softwares/evaluation/msa/pal2nal.v14/pal2nal.pl ${SAMPLE}.fa ${SAMPLE}.txt -output paml > ${SAMPLE}.paml.txt
done