17.09.2017

jmol.sh

<html>
<head>
<title></title>

<meta name="Subject" content="" />
<meta name="Publisher" content="" />
<meta name="Description" content="" />
<meta name="Contributors" content="" />
<meta name="Effective_date" content="None" />
<meta name="Expiration_date" content="None" />
<meta name="Type" content="LBSDocument" />
<meta name="Format" content="text/plain" />
<meta name="Language" content="None" />
<meta name="Rights" content="" />
<meta name="SafetyBelt" content="None" />
</head>
<body>
#!/bin/sh

# Collect -D & -m options as java arguments
command=java
while [ `echo $1 | egrep '^-D|^-m' | wc -l` != 0 ]; do
command="$command $1"
shift
done

# Determine installation location
if [ "$JMOL_HOME" = "" ]; then
binDir=${0%/*}
if [ "$binDir" = "$0" ]; then
# Ran from local directory
binDir=$PWD
fi
# Resolve symlinks.
program="$0"
while [ -L "$program" ]; do
ls=`/bin/ls -ld "$program"`
link=`/usr/bin/expr "$ls" : '.*-> \(.*\)$'`
if /usr/bin/expr "$link" : '.*/.*' > /dev/null; then
program="$link"
else
program="`/usr/bin/dirname $program`/$link"
fi
done
binDir=`dirname $program`
fi

JMOL_HOME=${JMOL_HOME:-$binDir}
libDir=${JMOL_HOME}/jars

if [ ! -e ${JMOL_HOME}/Jmol.jar ]; then
echo "Jmol could not find its installed files."
exit
fi

$command -Djmol.home="$JMOL_HOME" -jar ${JMOL_HOME}/Jmol.jar "$@"

</body>
</html>