#!/bin/bash for system in alphaL alphaR C7ax C7eq do ##prepare the input file with a command-line search-and-replace: sed -e "s/_RESTRAINTS_FILE_/$system.restraints/g" \ md1ns_rest.template.in > md_rest.$system.in ##fork using the `&' operator and launch sander (or pmemd): nice sander -O -i md_rest.$system.in \ -p diala.top -c diala.crd \ -o diala_md1.$system.out \ -x diala_md1.$system.x \ -r diala_md1.$system.rst & done