+
+cat << EOF >leap.bat
+source leaprc.ff14SB
+xx3 = loadpdb tmp1.pdb
+EOF
+
+pdb=$1
+shift
+while true; do
+ if [ $1 ]; then
+ echo bond xx3.$1.SG xx3.$2.SG >> leap.bat
+ awk -v ires=$1 -f ../files/cyx.awk $pdb > tmp1
+ awk -v ires=$2 -f ../files/cyx.awk tmp1 > $pdb
+ shift
+ shift
+ else
+ break
+ fi
+done
+cat << EOF >> leap.bat
+saveamberparm xx3 t.top t.crd
+savepdb xx3 z_tleap.pdb
+quit
+EOF
+
+$AMBERHOME/bin/tleap -f leap.bat