Run script on multiple files

ThePresident

I would like to execute a script on a batch of files all of which have .xml extension.

Inspired by previous posts, I tried the following:

for file in *.xml; do ./script.sh <"$file"; done

And

for i in $(\ls -d *.xml)
do
    ./script.sh -i /path/*.xml -d /output_folder $i
done

Both of these run the script many times but only on the first .xml file in that folder. So I end up with a dozen output files but all of them are file1.txt, file1.txt_1, file1.txt_2 etc. The loop stops randomly, sometimes after 3 iterations, sometimes after 28.

Any help would be appreciated, Thank you, TP

Charles Duffy
for f in /input_path/*.xml; do
  ./interproscan.sh -mode convert -f raw -i "$f" -d /output_path
done

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

sh script to run multiple files in multiple languages

From Dev

Run a script on multiple files using numbers in their names

From Dev

How to run a script on multiple files matching a regex?

From Dev

Run multiple script files SQL with a TransactSQL

From Dev

How to run multiple config files through a script?

From Dev

A shell script to run tabix command on multiple files

From Dev

How to run multiple jar files at once using shell script?

From Dev

How to run multiple jar files at once using shell script?

From Dev

Run multiple jar files sequentially (not simultaneously) using shell script and docker

From Dev

run a shell script in linux to process multiple .grb files

From Dev

Run a script on multiple shells?

From Dev

Run script on multiple hosts

From Dev

Run a script in multiple directories with multiple output files in Perl (problems comparing hash key values)

From Dev

Run ruby files through script

From Dev

Run a script with different input files

From Dev

Run ruby files through script

From Dev

Run a script with different input files

From Dev

How do I run this Python 2.7 script over multiple files in the same directory

From Dev

How to run hxnormalize on multiple files?

From Dev

Run multiple files in terminal simultaneously

From Dev

bash script rename multiple files

From Dev

multiple files as argument in bash script

From Dev

Shell script to delete multiple files

From Dev

Windows batch script for multiple files

From Dev

Bash script to unzip multiple files

From Dev

Including 'Run Script' phase output files in build

From Dev

Run Perl Script on Several files Simultaneously

From Dev

Search files and run a script on every result - Cont:

From Dev

tkinter - ask the user for files directory and then run a script

Related Related

  1. 1

    sh script to run multiple files in multiple languages

  2. 2

    Run a script on multiple files using numbers in their names

  3. 3

    How to run a script on multiple files matching a regex?

  4. 4

    Run multiple script files SQL with a TransactSQL

  5. 5

    How to run multiple config files through a script?

  6. 6

    A shell script to run tabix command on multiple files

  7. 7

    How to run multiple jar files at once using shell script?

  8. 8

    How to run multiple jar files at once using shell script?

  9. 9

    Run multiple jar files sequentially (not simultaneously) using shell script and docker

  10. 10

    run a shell script in linux to process multiple .grb files

  11. 11

    Run a script on multiple shells?

  12. 12

    Run script on multiple hosts

  13. 13

    Run a script in multiple directories with multiple output files in Perl (problems comparing hash key values)

  14. 14

    Run ruby files through script

  15. 15

    Run a script with different input files

  16. 16

    Run ruby files through script

  17. 17

    Run a script with different input files

  18. 18

    How do I run this Python 2.7 script over multiple files in the same directory

  19. 19

    How to run hxnormalize on multiple files?

  20. 20

    Run multiple files in terminal simultaneously

  21. 21

    bash script rename multiple files

  22. 22

    multiple files as argument in bash script

  23. 23

    Shell script to delete multiple files

  24. 24

    Windows batch script for multiple files

  25. 25

    Bash script to unzip multiple files

  26. 26

    Including 'Run Script' phase output files in build

  27. 27

    Run Perl Script on Several files Simultaneously

  28. 28

    Search files and run a script on every result - Cont:

  29. 29

    tkinter - ask the user for files directory and then run a script

HotTag

Archive