source: tags/initial/SH/arb

Last change on this file was 2, checked in by oldcode, 24 years ago

Initial revision

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.2 KB
Line 
1#!/bin/sh
2
3
4nargs=$#
5args="$*"
6
7# Add to the path variable named by $1 the component $2.  $3 must be
8# "append" or "prepend" to indicate where the component is added.
9
10# error message function
11err () {
12        echo "`basename $0`: $@" 1>&2
13        exit 1
14}
15
16addpath () {
17    eval value=\"\$$1\"
18    case "$value" in
19        *:$2:*|*:$2|$2:*|$2)
20            result="$value"
21            ;;
22        "")
23            result="$2"
24            ;;
25        *)
26            case "$3" in
27                p*)
28                    result="$2:${value}"
29                    ;;
30                *)
31                    result="${value}:$2"
32                    ;;
33            esac
34    esac
35    eval $1=$result
36    unset result value
37}
38
39# convenience routine which appends a string to a path.
40append () {
41    addpath "$1" "$2" append
42}
43
44# convenience routine which prepends a string to a path.
45prepend () {
46    addpath "$1" "$2" prepend
47}
48
49
50case "X${ARBHOME}" in
51  X)
52        if [ -x /usr/arb/bin/arb ];then
53                ARB=/usr/arb/bin/arb
54        else
55              case "$0" in
56                /*)
57                       ARB="$0";;
58                *)     
59                     if ARB=`which $0`; then
60                       echo $ARB
61                     else
62                       ARB=`pwd`/$0
63                     fi;;
64              esac
65        fi
66       
67        ARBBIN=`dirname $ARB`
68        export ARBBIN
69        ARBHOME=`dirname $ARBBIN`
70        export ARBHOME
71      echo "Environment Variable ARBHOME not set"
72      echo "    set to $ARBHOME";;
73esac
74
75prepend PATH                    $ARBHOME/bin
76prepend LD_LIBRARY_PATH         $ARBHOME/lib
77append  LD_LIBRARY_PATH         /usr/dt/lib
78append  LD_LIBRARY_PATH         /usr/openwin/lib
79prepend SHLIB_PATH              $ARBHOME/lib
80
81# environment variables that this shell script sets/changes:
82export LD_LIBRARY_PATH MANPATH PATH ARBHOME SHLIB_PATH
83
84# global envs:
85
86export PWD HOME USER
87
88if [ -x $ARBHOME/bin/ghostview ] ; then
89  GS_LIB="$ARBHOME/DEPOT/ghostscript"
90  export GS_LIB
91fi
92
93if [ "X$ARBMACROHOME" = "X" ] ; then
94  ARBMACROHOME="$ARBHOME/lib/macros"
95  export ARBMACROHOME
96fi
97
98ARB_PID="$$"; export ARB_PID
99
100if [ ! -d ${HOME}/.arb_prop ] ; then
101  echo 'Directory $HOME/.arb_prop not found creating ...'
102  mkdir ${HOME}/.arb_prop
103fi
104
105if [ "X$GDE_HELP_DIR" = "X" ] ; then
106  GDE_HELP_DIR="$ARBHOME/GDEHELP"
107  export GDE_HELP_DIR
108fi
109
110# Default Texteditor/CMDTOOL used by ARB
111. $ARBHOME/lib/config.`uname`
112
113# save LD_LIBRARY_PATH
114ARB_LIBRARY_PATH="${LD_LIBRARY_PATH}"
115export ARB_LIBRARY_PATH
116
117echo "Program ARB will be startet in the background, please wait"
118(arb_ntree $args;arb_clean >/dev/null 2>&1;echo ARB done) &
119
120
Note: See TracBrowser for help on using the repository browser.