#!/bin/ksh # Script to run ctrl2ab and xmp program for producing xmol file ctrl=CTRL out=xmol.dat ~/bin/ctrl2ab ~/bin/xmp tmp echo "Xmol file is:" xmol.dat # Make an appropriate jmol file as well (the only difference compared to # the xmol file is that the elements are referred to as "Aa" instead of # "AA". cat xmol.dat | perl -ane 'while ($_ =~ /\b([A-Z])([A-Z])\b/) { $a = index $_, $1.$2; print $`; $c = $2; $c =~ tr [A-Z][a-z]; print $1.$c; substr($_, 0, $a+2) = ""; } print $_' >| jmol.dat echo "Jmol file is:" jmol.dat exit 0