#! /bin/sh
#
# ott - shell for invoking the Object Type Translator
# Usage:  ott <option>=<option_value> ...
#
# Before running this script:
#   set <jdk or jre 1.5.0>/bin in your PATH
#
# Note: If $ORACLE_HOME is not set, the $CLASSPATH should be set 
# to the directories containing ojdbc5.jar, orai18n.jar and 
# ottclasses.zip
#

while [ $# -gt 0 ]
do
      case $1 in
      user*)
              OTTUSER="$OTTUSER $1"
              export OTTUSER ;;
      *)
              args="$args $1";;
      esac
shift
done

if [ "$ORACLE_HOME" ]
then
    JRECLASSPATH=:$ORACLE_HOME/jdbc/lib/ojdbc5.jar:$ORACLE_HOME/jlib/orai18n.jar:$ORACLE_HOME/precomp/lib/ottclasses.zip
    export JRECLASSPATH
    LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
    export LD_LIBRARY_PATH

    exec java -classpath $JRECLASSPATH oracle.ott.c.CMain nlslang=${NLS_LANG} orahome=${ORACLE_HOME} $args
else
    exec java oracle.ott.c.CMain nlslang=${NLS_LANG} $args
fi
