#!/bin/sh nargs=$# args="$*" # error message function err () { echo "`basename $0`: $@" 1>&2 exit 1 } # Add to the path variable named by $1 the component $2. $3 must be # "append" or "prepend" to indicate where the component is added. addpath () { eval value=\"\$$1\" case "$value" in *:$2:*|*:$2|$2:*|$2) result="$value" ;; "") result="$2" ;; *) case "$3" in p*) result="$2:${value}" ;; *) result="${value}:$2" ;; esac esac eval $1=$result unset result value } # convenience routine which appends a string to a path. append () { addpath "$1" "$2" append } # convenience routine which prepends a string to a path. prepend () { addpath "$1" "$2" prepend } case "X${ARBHOME}" in X) if [ -x /usr/arb/bin/arb ];then ARB=/usr/arb/bin/arb else case "$0" in /*) ARB="$0";; *) if ARB=`which $0`; then echo $ARB else ARB=`pwd`/$0 fi;; esac fi ARBBIN=`dirname $ARB` export ARBBIN ARBHOME=`dirname $ARBBIN` export ARBHOME echo "Environment Variable ARBHOME was empty" esac echo "Using ARBHOME='$ARBHOME'" prepend PATH $ARBHOME/bin prepend LD_LIBRARY_PATH $ARBHOME/lib append LD_LIBRARY_PATH /usr/dt/lib append LD_LIBRARY_PATH /usr/openwin/lib append LD_LIBRARY_PATH $ARBHOME/lib/addlibs prepend SHLIB_PATH $ARBHOME/lib append SHLIB_PATH $ARBHOME/lib/addlibs # environment variables that this shell script sets/changes: export LD_LIBRARY_PATH MANPATH PATH ARBHOME SHLIB_PATH # global envs: export PWD HOME USER if [ -x $ARBHOME/bin/ghostview ] ; then GS_LIB="$ARBHOME/DEPOT/ghostscript" export GS_LIB fi ARB_PID="$$"; export ARB_PID ARB_PROPERTIES=${HOME}/.arb_prop if [ ! -d ${ARB_PROPERTIES} ] ; then echo "Directory ${ARB_PROPERTIES} not found - creating ..." mkdir ${ARB_PROPERTIES} fi if [ "X$ARBMACROHOME" = "X" ] ; then ARBMACROHOME="${ARB_PROPERTIES}/macros"; export ARBMACROHOME fi if [ ! -d ${ARBMACROHOME} ] ; then echo "Directory $ARBMACROHOME not found - creating ..." mkdir ${ARBMACROHOME} fi if [ "X$ARBMACRO" = "X" ] ; then ARBMACRO="$ARBHOME/lib/macros" export ARBMACRO fi if [ ! -d ${ARBMACRO} ] ; then echo "Directory $ARBMACRO not found - creating ..." mkdir ${ARBMACRO} fi if [ "X$GDE_HELP_DIR" = "X" ] ; then GDE_HELP_DIR="$ARBHOME/GDEHELP" export GDE_HELP_DIR fi # Default Texteditor/CMDTOOL used by ARB . $ARBHOME/lib/config.`uname` # save LD_LIBRARY_PATH ARB_LIBRARY_PATH="${LD_LIBRARY_PATH}" export ARB_LIBRARY_PATH if [ "$args" = "shell" ]; then echo "Opening an ARB shell" sh else if [ "$1" = "trace" ]; then shift $ARBHOME/SH/arb_trace $* else echo "Please wait while the program ARB is starting ....." (arb_ntree $args;arb_clean >/dev/null 2>&1;echo ARB done) & fi fi