There is an error in my bash script. Here, I have taken i as the variable. And I expect to have -cpi md_0_1.part1.cpt and -cpo md_0_1.part2.cpt in the first command, gmx - cpi md_0_1.part2.cpt and -cpo md_0_1.part3.cpt in the second command and so on.

Below listed are the two errors coming up:

./mdbash.sh: line 7: i: command not found

./mdbash.sh: line 11: `$i': not a valid identifier

This is the content of my script:

#!/bin/bash

#SBATCH --job_name=MD_simulation

#SBATCH --nodes=1

#SBATCH --ntasks=1

#SBATCH --cpus-per-task=20

var=$(i)

for i in {1..120..1}

do

gmx mdrun -cpi md_0_1.part$i.cpt -v -deffnm md_0_1 -noappend -cpt 1 -cpo md_0_1.part`expr $i + 1`.cpt

done

More Praval Pratap Singh's questions See All
Similar questions and discussions