Gmx analysis on multiple directories

I ran simulations for multiple systems with same method; saved into different directories. I want to do same data analysis (gmx rms, cluster, hbond…) in all these directories. Is there a way to simultaneously apply a gmx command on multiple directories?

Thank you,
Neena

Hi Neena,
I wrote a script with loops, and set the directories and file names as variables.
In the loop, there were gmx commands.

Hope it helps.
Best,
Anh

Bash scripting will do the hack,

for dir in dir_1 dir_2 dir_n;
do 
    cd $dir
    gmx rms/cluster/hbond .....
    cd ..
done 

You might want to use echo n | gmx for non-interactive user input. Here n is user choice (if any) . You can echo multiple times ( e.g., echo n1 n2 | gmx)

Best,
Masrul