I just unpacked the jmol tarball into /usr/local/share/jmol/ and then to put jmol in my path I did this:
ln -s ../share/jmol/jmol.sh ./jmol
And then jmol didn't work:
Jmol could not find its installed files.
If, however, I did the following:
ln -s /usr/local/share/jmol/jmol.sh ./jmol
then it works fine.
So.... two suggestions for you:
* in the jmol script, also search for /usr/local/share as well as /usr/share. /usr/share should only be touched by the distro packaging system (apt, yum, emerge etc) while /usr/local/share is for the sysadmin to monkey with.
* in the jmol.sh script, change your regexp to be '/.*' not '.*/.*' as what you have currently just looks for any slash in the path not necessarily one at the start