How to run a command (1000 times) that requires two different types of input files

后端 未结 3 962
青春惊慌失措
青春惊慌失措 2021-01-17 03:56

I have calculated directed modularity by means of DirectedLouvain (https://github.com/nicolasdugue/DirectedLouvain). I am now trying to test the significance of the values o

3条回答
  •  无人共我
    2021-01-17 04:51

    You can use find to list your files and execute a command on all of them:

    find -name '*.ext' -exec ./runThisExecutable '{}' \;
    

    If you have a.ext and b.ext in a directory, this will run ./runThisExecutable a.ext and ./runThisExecutable b.ext.

    To test whether it identifies the right files, you can run it without -exec so it only prints the filenames:

    find -name '*.ext'
    ./a.ext
    ./b.ext
    

提交回复
热议问题