Is there any error in these command lines? [closed]

1

I am making comparisons between documents through Bash command lines and using a loop command. However, an error occurs with the results:

./anibatch.sh: line 38: ./ANIcalculator: No such file or directory
./anibatch.sh: line 39: ./ANIcalculator: No such file or directory
./anibatch.sh: line 40: ./ANIcalculator: No such file or directory
./anibatch.sh: line 41: ./ANIcalculator: No such file or directory
./anibatch.sh: line 3: ./ANIcalculator: No such file or directory
./anibatch.sh: line 4: ./ANIcalculator: No such file or directory
./anibatch.sh: line 5: ./ANIcalculator: No such file or directory
./anibatch.sh: line 6: ./ANIcalculator: No such file or directory
./anibatch.sh: line 7: ./ANIcalculator: No such file or directory
./anibatch.sh: line 8: ./ANIcalculator: No such file or directory
./anibatch.sh: line 9: ./ANIcalculator: No such file or directory
./anibatch.sh: line 10: ./ANIcalculator: No such file or directory

With such information, I want to know if the bash in question is wrong:

#!/bin/bash
for file in *fna; do
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_alginolyticus_DSM_5050_NBRC_15375.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_algorifonticola.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_alvei_DSM_29.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_antarcticus.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_borealis.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_chitinolyticus_NBRC_15660.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_curdlanolyticus_YK9.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_daejeonensis_DSM_15491.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_darwinianus.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_dauci.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_durus_ATCC_35681.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_durus.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_forsythiae_T98.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_glacialis.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_glucanolyticus.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_graminis.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_graminis_RSA19.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_harenae_DSM_16969.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_jilunlii.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_macquariensis_subsp._defensor.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_macquariensis_subsp._macquariensis.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_massiliensis_2301065_DSM_16942.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_odorifer.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_pabuli_NBRC_13638.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_pinihumi_DSM_23905_JCM_16419.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_pini_JCM_16418.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_polymyxa_ATCC_842.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_popilliae_ATCC_14706.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_riograndensis_SBR5.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_sabinae_T27.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_sanguinis_2301083_DSM_16941.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_senegalensis_JC66.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_sonchi_X19-5.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_sp._A9.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_stellifer.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_swuensis.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_taiwanensis_DSM_18679.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_wulumuqiensis.fna -outfile genoma_comparacao 
./ANIcalculator -genome1fna $file -genome2fna Paenibacillus_zanthoxyli_JH29.fna -outfile genoma_comparacao 
done
    
asked by anonymous 10.10.2016 / 19:48

2 answers

0

The error occurs because the files are not in the directory where you are running the script. One of the alternatives is inside your script you enter the folder where you find the files or the file:

    #!/bin/bash

    cd <caminho_do_arquivo>
    #restante do script
    
10.10.2016 / 20:07
0

It may be that the problem is in the file locations as the friend above said. A simple example you can do is with this test script. Create some files with the sample ".tst" extension and see if it displays them the way you need them.

As my example.

#!/bin/bash

folders="*.tst"

for i in $folders;do

        ls $i

done
    
13.10.2016 / 14:39