Skip to content
Advertisement

Bash for loop containing python script

New here!

I’m trying to loop a python script in bash that gets stats from fastq files. I want it to loop through all the fastq files in a directory and save the outputs in a text file. Ideally don’t want to edit the python script

This is the script that works when I’m not looping it:

JavaScript

This is the loop that doesn’t work for me:

JavaScript

Thank you

EDIT I have put the loop in a bash .sh script. The error message I get is ” looping_script.sh: line 5: syntax error near unexpected token do' looping_script.sh: line 5: do’ “

Advertisement

Answer

Like this if you want all results in a single file:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement