I am trying to run a script
in multiple folders that calls: a software, two input files that create automatically a folder as output (in the folder of the input), like:
./soft -in1 input1 -in2 input2
Also, I have multiple folders, like this:
├── Folder1
│ ├── input1.in1
│ ├── input1.in2
│ ├── soft.py
├── Folder2
│ ├── input2.in1
│ ├── input2.in2
│ ├── soft.py
├── script.sh
So, I want to do two processes:
First, run the script recursively (in all folders), and second, run 'X' repetitions of the script in each folde. I got this script to run recursively.
But I have problems trying to run the repetitions. I try using the seq
command, but the software ./soft
rewrite the output in each repetition. So, I need save the outputs in folders with the number of each repetition (e.g. \out_Folder1_rep1; \out_Folder1_rep2; \out_Folder1_rep3).
I need create the output-folders for each repetition before?. Can someone help me?
for dir in */; do
for r in in1; do
glob=*.${r}
"./soft" -in1 "$dir"/$glob -in2 "$dir"/$(basename -s .tpl $glob).in2 ;
done
done