I’m trying to select 4 atoms for dihedral computation using bash script of nucleic acid system:
for i in {2..85}; do
gmx select -f ../npt.trr -s ../npt.tpr -on alpha_$i.ndx -select "name O3' and resindex $(($i-1)) or name P and resindex $i or name O5' and resindex $i or name C5' and resindex $i"
done
The first problem is that I can’t escape the prime char in atom names (like in name O3’).
Any suggestions? Better solution?
Anyway could be usefull to deal with this problem…
This seems a bash related problem rather that a GROMACS one. Generally, in bash scripting you can escape characters with the \ character, have you tried it? Something like:
for i in {2...85};
do
gmx select -f ../npt.trr -s …/npt.tpr -on alpha_i.ndx -select "name O3\′ and resindex (($i-1)) or name P and resindex $i or name O5\’ and resindex $i or name C5\’ and resindex $i"
done