#!/bin/sh

#
# shell script to start DX.  normally called indirectly from /usr/bin/dx
#  so that $DXROOT can be interpreted if dx isn't installed in the default
#  directory.
#

# Name as reported with -version option 
version_name="Open Visualization Data Explorer Script"

#
# Define functions that are used first.
#

#
# Exit function
#
out() {
	echo "$0 : $errmsg"
	echo "(use -help to get usage information)"
	exit 1
}

# 
# simple help section
#
shorthelp() {
cat << EOFshorthelp
command line parameters:
 -program filename    start UI with this network
 -image               start DX with an image window as the anchor window 
 -edit                start DX with an editor window as the anchor window 
 -menubar             start DX with a small menubar as the anchor window 
 -startup             start DX with an initial startup panel (default) 

 -uionly              start the UI only (no exec)
 -script filename     start the exec only, in script mode, running this script
 -script              start the exec only, in script mode

 -host hostname       start executive on this machine
 -memory #Mbytes      set the amount of memory the exec uses

 -macros pathlist     directory list to search for UI macros
 -data pathlist       directory list to search for data files

 -prompter            start the DX Data Prompter
 -builder             start the DX Module Builder
 -tutor               start the DX Tutorial

 -morehelp            print man page with information about other options
 
EOFshorthelp

exit 1
}

#
# complete help section
#
longhelp() {

manbrowser="`/usr/bin/which man`"
if test -x "$manbrowser"; then
    "$manbrowser" 1 dx
else
    echo Failed to launch standard man browser.  Please check out man page
    echo 'dx(1)' with a man browser of your choice.
fi
exit 1

cat << EOFlonghelp
command line parameters:
 -host hostname       start executive on this machine               
 -local               start executive on the current machine (default)

 -program filename    start UI with this network
 -script filename     run exec only, in script mode, with this script
 -script              run exec only, in script mode

 -image               start DX with an image window as the anchor window 
 -edit                start DX with the VP Editor as the anchor 
 -menubar             start DX with a small menubar as the anchor window 
 -startup             start DX with an initial dialog (default) 

 -uionly              start the UI only (no exec)
 -execonly            start the exec only (no UI) in remote mode
 -connect host:port   start a distributed exec only (no UI)

 -prompter            start the DX Data Prompter
 -full                start the Full Data Prompter
 -file filename       start the Data Prompter with this header file

 -builder             start the DX Module Builder
 -tutor               start the DX Tutorial

 -suppress            do not open control panels at startup in image mode
 -execute             execute the program automatically at startup
 -execute_on_change   go into execute_on_change mode at startup

 -optimize [memory|precision]
                      select whether to minimize memory usage or to produce 
                      more color-accurate images.  When memory is optimized, 
                      image objects are generated with 24 bits/pixel instead 
                      of 96, and ReadImage will produce delayed color images 
                      if supported by the format. (default = precision)

 -memory #Mbytes      set the amount of memory the exec uses
 -processors #proc    set the number of processors the exec uses 
                      (SMP versions only)
 -log [on|off]        executive and ui logging: (default = off)
 -cache [on|off]      executive cache: (default = on)
 -trace [on|off]      executive trace: (default = off)
 -readahead [on|off]  executive readahead: (default = on)
 -timing [on|off]     module timing: (default = off)
 -highlight [on|off]  node execution highlighting: (default = on)
 -directory dirname   cd to this directory before starting exec
 -display hostname:0  set X display destination
 -metric              have the UI use metric units when possible

 -exec filename       execute this user executive
 -mdf filename        use this user .mdf file

 -key <64bit hex>     16 character hexidecimal (64 bit) number that is used
		      to encode and decode .net files.
 -encode              Encode a .net file into a binary format with a key 
                      that must be specified with the -key option.   
                      For example, 
                        dx -encode -key 193495946952abed foo.net 
                      The resulting file can only be decoded by the DX
                      user interface when using the same -key option.
                      For example, 
                        dx -key 193495946952abed bar.net 

 -dxroot dirname      dx root directory; defaults to /usr/lib/dx

 -macros pathlist     directory list to search for UI macros
 -data pathlist       directory list to search for data files
 -include pathlist    directory list to search for script files
 -modules pathlist    directory list to search for outboard modules

 -colors filename     replace default color names/RGB values file
 -8bitcmap [private|shared|0-1|-1]
                      private/shared colormap error threshold (default=0.1)
                      -1 is equivalent to private.
 -hwrender [gl|opengl]  
                      override default hardware rendering library on platforms
                      where both are supported.  (default = opengl).

 -license <type>      force a specific license for either the UI or executive.
                      type should be one of:
    runtime           force a run-time license (UI or executive)
    timed             force a timed (limited function) license (UI only)
    develop           force a developer license (UI or executive) (default)

 -nodeid              print out the node id which is used for licensing

 -verbose             echo command lines before executing
 -echo                echo the command lines without executing them
 -outboarddebug       let user start outboard modules by hand
 -version             show version numbers of the dxexec and dxui

 -help                print a short help message
 -morehelp            print this help message

environment variables:
 DXHOST               sets hostname for -host

 DXPROCESSORS         sets number of processors for multiprocessor DX
 DXMEMORY             sets memory limit in megabytes

 DXEXEC               sets filename for -exec
 DXMDF                sets filename for -mdf

 DXMACROS             sets pathlist for -macros
 DXDATA               sets pathlist for -data
 DXINCLUDE            sets pathlist for -include
 DXMODULES            sets pathlist for -modules

 DXCOLORS             sets filename for -colors
 DX8BITCMAP           sets threshold for -8bitcmap
 DXDELAYEDCOLORS      enables ReadImage to create delayed color images if the
                      image is a tiff format image saved in a byte-with-colormap
                      format or a GIF format. This feature is enabled if this
                      variable is set to any value. Delayed colors use less
                      memory.

 DXGAMMA              sets gamma correction for displayed images. Default is 2.
 DXGAMMA_8BIT
 DXGAMMA_12BIT
 DXGAMMA_24BIT        sets the gamma correction factor for the windows with 
                      the indicated window depth.  Overrides the value set 
                      by DXGAMMA.
 DXHWGAMMA            Sets the gamma correction for hardware-rendered images
                      displayed to the screen using the Display and Image tools.
                      The default value is 2.  

 DXHWMOD              specifies the name of the hardware rendering library 
                      to use when more than one is supported. Should be
                      either DXhwdd.o or DXhwddOGL.o
 DXNO_BACKING_STORE   if set to anything, disables framebuffer readbacks.
                      Setting this environment variable will improve performance
                      of interaction with hardware rendered images, especially
                      for machines for which readback is slow. However, some of
                      the interactions in the image window (such as zoom) will
                      result in a black image while interaction is taking place.
                      Default is framebuffer readbacks are enabled.
 DXFLING              If DXFLING is set to 1, then for hardware-rendered images,
                      in rotation mode and execute-on-change mode, if you drag the
                      mouse across the image, and release the mouse button outside
                      the image, the object in the image will begin to rotate, and
                      will continue to rotate until you click inside the image. 

 DXAXESMAXWIDTH       sets the number of digits in axes tick labels at which a
                      switch to scientific notation is made. The default is 7.
                      
 DX_NESTED_LOOPS      for faces, loops, and edges data, if set, allows loops other
                      than the enclosing loop for a face to be listed first. However,
                      there is a consequent decrease in performance if this
                      environment variable is set.
 
 DXPIXELTYPE          sets the image type to either 24-bit color images or floating-
                      point-based 96-bit images (the default). This affects the 
                      behavior of Render and ReadImage. This variable can be set to
                      either DXByte (24 bits) or DXFloat (96 bits). Setting this
                      variable to DXByte will result in images taking up less memory.

 DXRSH                specifies the remote shell command to use when connecting to
                      other systems (such as those when using distributed execution).
                      The default is the the path to rsh.
 DXRSH_NOENV          prevents the remote "invoke dxexec" script from being written
                      with a full carbon copy of the local environment (only DISPLAY
                      is set).

 DXROOT               sets directory for -dxroot
 
 DXSHMEM              If set to anything other than -1, forces shared memory to be
                      used (if allowed by the architecture).  If set to -1, (if allowed
                      by the architecture) will cause the data segment to simply be
                      extended. Please see Appendix C of the Data Explorer User Guide
                      for more information.
                      
 DXSHMEMSEGMAX        Some architectures have a default configuration which limits
                      the size of shared memory segments (see the architecture
                      specific README file in /usr/lpp/dx), and the system
                      configuration must be changed as root to increase the maximum
                      allowed size of a shared memory segment.

 DX_SOCKET_BUFSIZE    allows the user to specify the size of the send and recieve
                      buffers for the socket connection between the UI and the exec.

 DX_WEB_BROWSER       under UNIX specifies the web browser to launch for viewing the 
                      HTML documentation. Under Windows and MacOS X setting this 
                      environment variable will launch the systems default web browser.

 DXARGS               prepends these args to the command line

command line parameters override environment variables.
If conflicting parameters are given, the last one has precedence.
Also, there are some other less frequently used command line options
that are not documented here.  See the User's Guide for a complete
list of options.

EOFlonghelp
exit 1
}

# Start of original dx startup script

# Parse the -dxroot option so that we can handle the case in which
# a UI installed with one DXROOT can connect to a machine with
# another DXROOT. 
#
x=`echo "$*" | grep  'dxroot'`
ARGS="$*"
if [ ! -z "$x" ]; then
    while [ ! "$*" = "" ]; do
	case $1 in
	    -dxroot)   DXROOT=$2; shift ;;
	    *)      
	    ;;
	esac
	shift
    done
fi


if [ -z "$DXROOT" ]; then
  prefix=/usr/lib
  DXROOT=$prefix/dx
fi
export DXROOT

if [ -z "$DXDATA" ]; then
  DXDATA=$DXROOT/samples/data
  if [ -d "$DXDATA" ]; then
    export DXDATA
  fi
fi

# if DXMACROS not set, default it to the usual unless dir doesn't exist
if [ -z "$DXMACROS" ]; then
  DXMACROS=$DXROOT/samples/macros
  if [ ! -d "$DXMACROS" ]; then
	DXMACROS=
  fi
fi
#
# if JXMACROS not set and default dir exists, add it to the DXMACROS path
# These macros are needed by dxui in order to prepare nets for operation
# under control of DXServer.
if [ -z "$JXMACROS" ]; then
  JXMACROS=$DXROOT/java/server/dxmacros
  if  [ -d "$JXMACROS" ]; then
	if [ -z "$DXMACROS" ]; then
		DXMACROS=$JXMACROS
	else
		DXMACROS=$DXMACROS:$JXMACROS
	fi
  fi
fi

if [ ! -z "$DXMACROS" ]; then
	 export DXMACROS
fi

# End of original dx startup script


# machine type, hostname, version etc
# current machine hostname & version
thissys=`uname  -s | sed -e 's/ ..*$//'`
thismach=`uname  -m`
thishost=`hostname | sed -e 's/\..*$//'` 
thisver=`uname  -r`
remote=/usr/bin/rsh
showversion=0

# determine the machine type, and set uiarch, exarch and thisver defaults
case $thissys in
  FreeBSD)
    exarch=freebsd
    uiarch=freebsd

    remote=/usr/bin/rsh

    ;;

  AIX*)
    exarch=ibm6000
    uiarch=ibm6000

    thisver=`uname  -v`
    thisver2=`uname  -v`.`uname  -r`

    #
    # The following is a work-around for a problem involved with NLS support
    # and .net file reading on AIX.
    #
    LANG=C
    LC_ALL=C
    export LANG
    export LC_ALL

    # this is for AIX 3.2.3e, so we get the right libs at run time
    if test "z$thisver2" = "z3.2" ; then
		LIBPATH=/usr/lib:/lib
		export LIBPATH
    fi

    ;;

  IRIX*)
    exarch=sgi
    uiarch=sgi    

    remote=/usr/bsd/rsh

    if test "z$thisver" = "z5.1.1.1" ; then
      __SGI_NO_REMOTE_GL=1
      export __SGI_NO_REMOTE_GL
	fi

    unset XUSERFILESEARCHPATH
    export XUSERFILESEARCHPATH

    ;;

  SunOS*)
    # the version comes out as A.B.C - we want just A
    osver=`echo $thisver | sed -e '/.\..\../s/\..$//'`
    minorver=`echo $osver | sed -e 's/^.\.//'`
    majorver=$osver:r
    if test $majorver -ge 5 ; then
      exarch=solaris
      uiarch=solaris
      if test "$LD_LIBRARY_PATH" ; then
        LD_LIBRARY_PATH=$LD_LIBRARY_PATH":/usr/openwin/lib:/opt/SUNWits/Graphics-sw/xgl-3.0/lib:/usr/ucblib:/usr/local/lib"
      else
        LD_LIBRARY_PATH="/usr/openwin/lib:/opt/SUNWits/Graphics-sw/xgl-3.0/lib:/usr/ucblib:/usr/local/lib"
	  fi
      #
      # in Solaris 8 and higher, the inclusion of /usr/ucblib causes problems
      # with dx launching the exec programatically (probably similar to
      # the problem in SunOS4 below.
      #
      if test $minorver -ge 8 ; then
         LD_LIBRARY_PATH=`echo "$LD_LIBRARY_PATH" | sed -e 's?/usr/ucblib??g' -e 's?:[:]*?:?g'`
      fi
	  export LD_LIBRARY_PATH
    else
      exarch=sun4
      uiarch=sun4
      remote=/usr/ucb/rsh

      #
      # This is to work around a problem on SunOS4, in which a reference 
      # to a directory that is included by default causes
      # 'dlopen:stub interception failed' messages to appear when attempting
      # hw rendering.
      #
      if test "$LD_LIBRARY_PATH" ; then
        LD_LIBRARY_PATH=`echo "$LD_LIBRARY_PATH" | sed -e 's?/usr/ucblib??g' -e 's?/usr/lib??g' -e 's?:[:]*?:?g'`
        export LD_LIBRARY_PATH
      fi

    fi

    # make sure we don't use openwin files
    unset XFILESEARCHPATH
    export XFILESEARCHPATH

    ;;

  HP-UX*)
    exarch=hp700
    uiarch=hp700

    thisver=`uname  -m | cut -c1-6`
    remote=/usr/bin/remsh

    ;;

  dgux)
    exarch=aviion
    uiarch=aviion

    remote=/usr/bin/remsh

    ;;

  OSF1*)
    exarch=alphax
    uiarch=alphax

    ;;

  Linux)
    exarch=linux
    uiarch=linux

    remote=/usr/bin/rsh

    ;;

  CYGWIN*)
   exarch=cygwin
   uiarch=cygwin    
 
   remote=/usr/bin/rsh
 
   ;;

  Darwin*)
   exarch=macos
   uiarch=macos    
 
   remote=/usr/bin/rsh
 
   if [ -z "$DXMACROS" ]; then
      if [ -d "$HOME/Library/Application Support/OpenDX/macros" ]; then
         DXMACROS="$HOME/Library/Application Support/OpenDX/macros"
      fi
   else
      if [ -d "$HOME/Library/Application Support/OpenDX/macros" ]; then
         DXMACROS="$DXMACROS:$HOME/Library/Application Support/OpenDX/macros"
      fi
   fi
   if [ ! -z "$DXMACROS" ]; then
       export DXMACROS
   fi

   DX_WEB_BROWSER=1
   export DX_WEB_BROWSER

   ;;

  *)
    echo "unknown machine type"
    exit 1

    ;;
esac

DXARCH=$exarch
export DXARCH

# default to running locally, from /usr/lib/dx  
exhost=$thishost
dxroot=/usr/lib/dx
startup=1   # run the startup window by default


# initialize these so later they can be used, even the first time.
xparms=
dxargs=""
envargs=""
uiflags=""
prompterflags=""
exmdf=""
uimdf=""
errmsg=""
FileName=        # Name of filename given on command line w/o option
ScriptCmd=""       # Script command invocation to execute
uirestrict=""
echoparms=
seecomline=0
exlic=
motifcmd=
motifbind=
builder=0
encoder=0
tutor=0
prompter=0
exonly=0
uionly=0
wizard=0
exhilite=-B
uimode=-edit
exonly=0
exmode=-r
port=1900
cdto=`pwd`

#
# if DXARGS defined, use them as the default args to this command.
#  append any other command line args afterwards
#
if test "$DXARGS" ; then 
  dxargs="$DXARGS"
fi


# have to use all env variables here to set parms, because if we use rsh
#  to start dx on another machine, environment varsarwin*)  # The following is a work-around for a problem involved with NLS support
    # and .net file reading on AIX.
    #
    LANG=C
    LC_ALL=C
    export LANG
    export LC_ALL

    # this is for AIX 3.2.3e, so we get the right libs at run time
    if test "z$thisver2" = "z3.2" ; then
		LIBPATH=/usr/lib:/lib
		export LIBPATH
    fi

    ;;

  IRIX*)
    exarch=sgi
    uiarch=sgi    

    remote=/usr/bsd/rsh

    if test "z$thisver" = "z5.1.1.1" ; then
      __SGI_NO_REMOTE_GL=1
      export __SGI_NO_REMOTE_GL
	fi

    unset XUSERFILESEARCHPATH
    export XUSERFILESEARCHPATH

    ;;

  SunOS*)
    # the version comes out as A.B.C - we want just A
    osver=`echo $thisver | sed -e '/.\..\../s/\..$//'`
    minorver=`echo $osver | sed -e 's/^.\.//'`
    majorver=$osver:r
    if test $majorver -ge 5 ; then
      exarch=solaris
      uiarch=solaris
      if test "$LD_LIBRARY_PATH" ; then
        LD_LIBRARY_PATH=$LD_LIBRARY_PATH":/usr/openwin/lib:/opt/SUNWits/Graphics-sw/xgl-3.0/lib:/usr/ucblib:/usr/local/lib"
      else
        LD_LIBRARY_PATH="/usr/openwin/lib:/opt/SUNWits/Graphics-sw/xgl-3.0/lib:/usr/ucblib:/usr/local/lib"
	  fi
      #
      # in Solaris 8 and higher, the inclusion of /usr/ucblib causes problems
      # with dx launching the exec programatically (probably similar to
      # the problem in SunOS4 below.
      #
      if test $minorver -ge 8 ; then
         LD_LIBRARY_PATH=`echo "$LD_LIBRARY_PATH" | sed -e 's?/usr/ucblib??g' -e 's?:[:]*?:?g'`
      fi
	  export LD_LIBRARY_PATH
    else
      exarch=sun4
      uiarch=sun4
      remote=/usr/ucb/rsh

      #
      # This is to work around a problem on SunOS4, in which a reference 
      # to a directory that is included by default causes
      # 'dlopen:stub interception failed' messages to appear when attempting
      # hw rendering.
      #
      if test "$LD_LIBRARY_PATH" ; then
        LD_LIBRARY_PATH=`echo "$LD_LIBRARY_PATH" | sed -e 's?/usr/ucblib??g' -e 's?/usr/lib??g' -e 's?:[:]*?:?g'`
        export LD_LIBRARY_PATH
      fi

    fi

    # make sure we don't use openwin files
    unset XFILESEARCHPATH
    export XFILESEARCHPATH

    ;;

  HP-UX*)
    exarch=hp700
    uiarch=hp700

    thisver=`uname  -m | cut -c1-6`
    remote=/usr/bin/remsh

    ;;

  dgux)
    exarch=aviion
    uiarch=aviion

    remote=/usr/bin/remsh

    ;;

  OSF1*)
    exarch=alphax
    uiarch=alphax

    ;;

  Linux)
    exarch=linux
    uiarch=linux

    remote=/usr/bin/rsh

    ;;

  CYGWIN*)
   exarch=cygwin
   uiarch=cygwin    
 
   remote=/usr/bin/rsh
 
   ;;

  Darwin*)
   exarch=macos
   uiarch=macos    
 
   remote=/usr/bin/rsh
 
   if [ -z "$DXMACROS" ]; then
      if [ -d "$HOME/Library/Application Support/OpenDX/macros" ]; then
         DXMACROS="$HOME/Library/Application Support/OpenDX/macros"
      fi
   else
      if [ -d "$HOME/Library/Application Support/OpenDX/macros" ]; then
         DXMACROS="$DXMACROS:$HOME/Library/Application Support/OpenDX/macros"
      fi
   fi
   if [ ! -z "$DXMACROS" ]; then
       export DXMACROS
   fi

   DX_WEB_BROWSER=1
   export DX_WEB_BROWSER

   ;;

  *)
    echo "unknown machine type"
    exit 1

    ;;
esac

DXARCH=$exarch
export DXARCH

# default to running locally, from /usr/lib/dx  
exhost=$thishost
dxroot=/usr/lib/dx
startup=1   # run the startup window by default


# initialize these so later they can be used, even the first time.
xparms=
dxargs=""
envargs=""
uiflags=""
prompterflags=""
exmdf=""
uimdf=""
errmsg=""
FileName=        # Name of filename given on command line w/o option
ScriptCmd=""       # Script command invocation to execute
uirestrict=""
echoparms=
seecomline=0
exlic=
motifcmd=
motifbind=
builder=0
encoder=0
tutor=0
prompter=0
exonly=0
uionly=0
wizard=0
exhilite=-B
uimode=-edit
exonly=0
exmode=-r
port=1900
cdto=`pwd`

#
# if DXARGS defined, use them as the default args to this command.
#  append any other command line args afterwards
#
if test "$DXARGS" ; then 
  dxargs="$DXARGS"
fi


# have to use all env variables here to set parms, because if we use rsh
#  to start dx on another machine, environment varsarwin*)  # The following is a work-around for a problem involved with NLS support
    # and .net file reading on AIX.
    #
    LANG=C
    LC_ALL=C
    export LANG
    export LC_ALL

    # this is for AIX 3.2.3e, so we get the right libs at run time
    if test "z$thisver2" = "z3.2" ; then
		LIBPATH=/usr/lib:/lib
		export LIBPATH
    fi

    ;;

  IRIX*)
    exarch=sgi
    uiarch=sgi    

    remote=/usr/bsd/rsh

    if test "z$thisver" = "z5.1.1.1" ; then
      __SGI_NO_REMOTE_GL=1
      export __SGI_NO_REMOTE_GL
	fi

    unset XUSERFILESEARCHPATH
    export XUSERFILESEARCHPATH

    ;;

  SunOS*)
    # the version comes out as A.B.C - we want just A
    osver=`echo $thisver | sed -e '/.\..\../s/\..$//'`
    minorver=`echo $osver | sed -e 's/^.\.//'`
    majorver=$osver:r
    if test $majorver -ge 5 ; then
      exarch=solaris
      uiarch=solaris
      if test "$LD_LIBRARY_PATH" ; then
        LD_LIBRARY_PATH=$LD_LIBRARY_PATH":/usr/openwin/lib:/opt/SUNWits/Graphics-sw/xgl-3.0/lib:/usr/ucblib:/usr/local/lib"
      else
        LD_LIBRARY_PATH="/usr/openwin/lib:/opt/SUNWits/Graphics-sw/xgl-3.0/lib:/usr/ucblib:/usr/local/lib"
	  fi
      #
      # in Solaris 8 and higher, the inclusion of /usr/ucblib causes problems
      # with dx launching the exec programatically (probably similar to
      # the problem in SunOS4 below.
      #
      if test $minorver -ge 8 ; then
         LD_LIBRARY_PATH=`echo "$LD_LIBRARY_PATH" | sed -e 's?/usr/ucblib??g' -e 's?:[:]*?:?g'`
      fi
	  export LD_LIBRARY_PATH
    else
      exarch=sun4
      uiarch=sun4
      remote=/usr/ucb/rsh

      #
      # This is to work around a problem on SunOS4, in which a reference 
      # to a directory that is included by default causes
      # 'dlopen:stub interception failed' messages to appear when attempting
      # hw rendering.
      #
      if test "$LD_LIBRARY_PATH" ; then
        LD_LIBRARY_PATH=`echo "$LD_LIBRARY_PATH" | sed -e 's?/usr/ucblib??g' -e 's?/usr/lib??g' -e 's?:[:]*?:?g'`
        export LD_LIBRARY_PATH
      fi

    fi

    # make sure we don't use openwin files
    unset XFILESEARCHPATH
    export XFILESEARCHPATH

    ;;

  HP-UX*)
    exarch=hp700
    uiarch=hp700

    thisver=`uname  -m | cut -c1-6`
    remote=/usr/bin/remsh

    ;;

  dgux)
    exarch=aviion
    uiarch=aviion

    remote=/usr/bin/remsh

    ;;

  OSF1*)
    exarch=alphax
    uiarch=alphax

    ;;

  Linux)
    exarch=linux
    uiarch=linux

    remote=/usr/bin/rsh

    ;;

  CYGWIN*)
   exarch=cygwin
   uiarch=cygwin    
 
   remote=/usr/bin/rsh
 
   ;;

  Darwin*)
   exarch=macos
   uiarch=macos    
 
   remote=/usr/bin/rsh
 
   if [ -z "$DXMACROS" ]; then
      if [ -d "$HOME/Library/Application Support/OpenDX/macros" ]; then
         DXMACROS="$HOME/Library/Application Support/OpenDX/macros"
      fi
   else
      if [ -d "$HOME/Library/Application Support/OpenDX/macros" ]; then
         DXMACROS="$DXMACROS:$HOME/Library/Application Support/OpenDX/macros"
      fi
   fi
   if [ ! -z "$DXMACROS" ]; then
       export DXMACROS
   fi

   DX_WEB_BROWSER=1
   export DX_WEB_BROWSER

   ;;

  *)
    echo "unknown machine type"
    exit 1

    ;;
esac

DXARCH=$exarch
export DXARCH

# default to running locally, from /usr/lib/dx  
exhost=$thishost
dxroot=/usr/lib/dx
startup=1   # run the startup window by default


# initialize these so later they can be used, even the first time.
xparms=
dxargs=""
envargs=""
uiflags=""
prompterflags=""
exmdf=""
uimdf=""
errmsg=""
FileName=        # Name of filename given on command line w/o option
ScriptCmd=""       # Script command invocation to execute
uirestrict=""
echoparms=
seecomline=0
exlic=
motifcmd=
motifbind=
builder=0
encoder=0
tutor=0
prompter=0
exonly=0
uionly=0
wizard=0
exhilite=-B
uimode=-edit
exonly=0
exmode=-r
port=1900
cdto=`pwd`

#
# if DXARGS defined, use them as the default args to this command.
#  append any other command line args afterwards
#
if test "$DXARGS" ; then 
  dxargs="$DXARGS"
fi


# have to use all env variables here to set parms, because if we use rsh
#  to start dx on another machine, environment varsarwin*)  # The following is a work-around for a problem involved with NLS support
    # and .net file reading on AIX.
    #
    LANG=C
    LC_ALL=C
    export LANG
    export LC_ALL

    # this is for AIX 3.2.3e, so we get the right libs at run time
    if test "z$thisver2" = "z3.2" ; then
		LIBPATH=/usr/lib:/lib
		export LIBPATH
    fi

    ;;

  IRIX*)
    exarch=sgi
    uiarch=sgi    

    remote=/usr/bsd/rsh

    if test "z$thisver" = "z5.1.1.1" ; then
      __SGI_NO_REMOTE_GL=1
      export __SGI_NO_REMOTE_GL
	fi

    unset XUSERFILESEARCHPATH
    export XUSERFILESEARCHPATH

    ;;

  SunOS*)
    # the version comes out as A.B.C - we want just A
    osver=`echo $thisver | sed -e '/.\..\../s/\..$//'`
    minorver=`echo $osver | sed -e 's/^.\.//'`
    majorver=$osver:r
    if test $majorver -ge 5 ; then
      exarch=solaris
      uiarch=solaris
      if test "$LD_LIBRARY_PATH" ; then
        LD_LIBRARY_PATH=$LD_LIBRARY_PATH":/usr/openwin/lib:/opt/SUNWits/Graphics-sw/xgl-3.0/lib:/usr/ucblib:/usr/local/lib"
      else
        LD_LIBRARY_PATH="/usr/openwin/lib:/opt/SUNWits/Graphics-sw/xgl-3.0/lib:/usr/ucblib:/usr/local/lib"
	  fi
      #
      # in Solaris 8 and higher, the inclusion of /usr/ucblib causes problems
      # with dx launching the exec programatically (probably similar to
      # the problem in SunOS4 below.
      #
      if test $minorver -ge 8 ; then
         LD_LIBRARY_PATH=`echo "$LD_LIBRARY_PATH" | sed -e 's?/usr/ucblib??g' -e 's?:[:]*?:?g'`
      fi
	  export LD_LIBRARY_PATH
    else
      exarch=sun4
      uiarch=sun4
      remote=/usr/ucb/rsh

      #
      # This is to work around a problem on SunOS4, in which a reference 
      # to a directory that is included by default causes
      # 'dlopen:stub interception failed' messages to appear when attempting
      # hw rendering.
      #
      if test "$LD_LIBRARY_PATH" ; then
        LD_LIBRARY_PATH=`echo "$LD_LIBRARY_PATH" | sed -e 's?/usr/ucblib??g' -e 's?/usr/lib??g' -e 's?:[:]*?:?g'`
        export LD_LIBRARY_PATH
      fi

    fi

    # make sure we don't use openwin files
    unset XFILESEARCHPATH
    export XFILESEARCHPATH

    ;;

  HP-UX*)
    exarch=hp700
    uiarch=hp700

    thisver=`uname  -m | cut -c1-6`
    remote=/usr/bin/remsh

    ;;

  dgux)
    exarch=aviion
    uiarch=aviion

    remote=/usr/bin/remsh

    ;;

  OSF1*)
    exarch=alphax
    uiarch=alphax

    ;;

  Linux)
    exarch=linux
    uiarch=linux

    remote=/usr/bin/rsh

    ;;

  CYGWIN*)
   exarch=cygwin
   uiarch=cygwin    
 
   remote=/usr/bin/rsh
 
   ;;

  Darwin*)
   exarch=macos
   uiarch=macos    
 
   remote=/usr/bin/rsh
 
   if [ -z "$DXMACROS" ]; then
      if [ -d "$HOME/Library/Application Support/OpenDX/macros" ]; then
         DXMACROS="$HOME/Library/Application Support/OpenDX/macros"
      fi
   else
      if [ -d "$HOME/Library/Application Support/OpenDX/macros" ]; then
         DXMACROS="$DXMACROS:$HOME/Library/Application Support/OpenDX/macros"
      fi
   fi
   if [ ! -z "$DXMACROS" ]; then
       export DXMACROS
   fi

   DX_WEB_BROWSER=1
   export DX_WEB_BROWSER

   ;;

  *)
    echo "unknown machine type"
    exit 1

    ;;
esac

DXARCH=$exarch
export DXARCH

# default to running locally, from /usr/lib/dx  
exhost=$thishost
dxroot=/usr/lib/dx
startup=1   # run the startup window by default


# initialize these so later they can be used, even the first time.
xparms=
dxargs=""
envargs=""
uiflags=""
prompterflags=""
exmdf=""
uimdf=""
errmsg=""
FileName=        # Name of filename given on command line w/o option
ScriptCmd=""       # Script command invocation to execute
uirestrict=""
echoparms=
seecomline=0
exlic=
motifcmd=
motifbind=
builder=0
encoder=0
tutor=0
prompter=0
exonly=0
uionly=0
wizard=0
exhilite=-B
uimode=-edit
exonly=0
exmode=-r
port=1900
cdto=`pwd`

#
# if DXARGS defined, use them as the default args to this command.
#  append any other command line args afterwards
#
if test "$DXARGS" ; then 
  dxargs="$DXARGS"
fi


# have to use all env variables here to set parms, because if we use rsh
#  to start dx on another machine, environment varsarwin*)  # The following is a work-around for a problem involved with NLS support
    # and .net file reading on AIX.
    #
    LANG=C
    LC_ALL=C
    export LANG
    export LC_ALL

    # this is for AIX 3.2.3e, so we get the right libs at run time
    if test "z$thisver2" = "z3.2" ; then
		LIBPATH=/usr/lib:/lib
		export LIBPATH
    fi

    ;;

  IRIX*)
    exarch=sgi
    uiarch=sgi    

    remote=/usr/bsd/rsh

    if test "z$thisver" = "z5.1.1.1" ; then
      __SGI_NO_REMOTE_GL=1
      export __SGI_NO_REMOTE_GL
	fi

    unset XUSERFILESEARCHPATH
    export XUSERFILESEARCHPATH

    ;;

  SunOS*)
    # the version comes out as A.B.C - we want just A
    osver=`echo $thisver | sed -e '/.\..\../s/\..$//'`
    minorver=`echo $osver | sed -e 's/^.\.//'`
    majorver=$osver:r
    if test $majorver -ge 5 ; then
      exarch=solaris
      uiarch=solaris
      if test "$LD_LIBRARY_PATH" ; then
        LD_LIBRARY_PATH=$LD_LIBRARY_PATH":/usr/openwin/lib:/opt/SUNWits/Graphics-sw/xgl-3.0/lib:/usr/ucblib:/usr/local/lib"
      else
        LD_LIBRARY_PATH="/usr/openwin/lib:/opt/SUNWits/Graphics-sw/xgl-3.0/lib:/usr/ucblib:/usr/local/lib"
	  fi
      #
      # in Solaris 8 and higher, the inclusion of /usr/ucblib causes problems
      # with dx launching the exec programatically (probably similar to
      # the problem in SunOS4 below.
      #
      if test $minorver -ge 8 ; then
         LD_LIBRARY_PATH=`echo "$LD_LIBRARY_PATH" | sed -e 's?/usr/ucblib??g' -e 's?:[:]*?:?g'`
      fi
	  export LD_LIBRARY_PATH
    else
      exarch=sun4
      uiarch=sun4
      remote=/usr/ucb/rsh

      #
      # This is to work around a problem on SunOS4, in which a reference 
      # to a directory that is included by default causes
      # 'dlopen:stub interception failed' messages to appear when attempting
      # hw rendering.
      #
      if test "$LD_LIBRARY_PATH" ; then
        LD_LIBRARY_PATH=`echo "$LD_LIBRARY_PATH" | sed -e 's?/usr/ucblib??g' -e 's?/usr/lib??g' -e 's?:[:]*?:?g'`
        export LD_LIBRARY_PATH
      fi

    fi

    # make sure we don't use openwin files
    unset XFILESEARCHPATH
    export XFILESEARCHPATH

    ;;

  HP-UX*)
    exarch=hp700
    uiarch=hp700

    thisver=`uname  -m | cut -c1-6`
    remote=/usr/bin/remsh

    ;;

  dgux)
    exarch=aviion
    uiarch=aviion

    remote=/usr/bin/remsh

    ;;

  OSF1*)
    exarch=alphax
    uiarch=alphax

    ;;

  Linux)
    exarch=linux
    uiarch=linux

    remote=/usr/bin/rsh

    ;;

  CYGWIN*)
   exarch=cygwin
   uiarch=cygwin    
 
   remote=/usr/bin/rsh
 
   ;;

  Darwin*)
   exarch=macos
   uiarch=macos    
 
   remote=/usr/bin/rsh
 
   if [ -z "$DXMACROS" ]; then
      if [ -d "$HOME/Library/Application Support/OpenDX/macros" ]; then
         DXMACROS="$HOME/Library/Application Support/OpenDX/macros"
      fi
   else
      if [ -d "$HOME/Library/Application Support/OpenDX/macros" ]; then
         DXMACROS="$DXMACROS:$HOME/Library/Application Support/OpenDX/macros"
      fi
   fi
   if [ ! -z "$DXMACROS" ]; then
       export DXMACROS
   fi

   DX_WEB_BROWSER=1
   export DX_WEB_BROWSER

   ;;

  *)
    echo "unknown machine type"
    exit 1

    ;;
esac

DXARCH=$exarch
export DXARCH

# default to running locally, from /usr/lib/dx  
exhost=$thishost
dxroot=/usr/lib/dx
startup=1   # run the startup window by default


# initialize these so later they can be used, even the first time.
xparms=
dxargs=""
envargs=""
uiflags=""
prompterflags=""
exmdf=""
uimdf=""
errmsg=""
FileName=        # Name of filename given on command line w/o option
ScriptCmd=""       # Script command invocation to execute
uirestrict=""
echoparms=
seecomline=0
exlic=
motifcmd=
motifbind=
builder=0
encoder=0
tutor=0
prompter=0
exonly=0
uionly=0
wizard=0
exhilite=-B
uimode=-edit
exonly=0
exmode=-r
port=1900
cdto=`pwd`

#
# if DXARGS defined, use them as the default args to this command.
#  append any other command line args afterwards
#
if test "$DXARGS" ; then 
  dxargs="$DXARGS"
fi


# have to use all env variables here to set parms, because if we use rsh
#  to start dx on another machine, environment varsarwin*)  # The following is a work-around for a problem involved with NLS support
    # and .net file reading on AIX.
    #
    LANG=C
    LC_ALL=C
    export LANG
    export LC_ALL

    # this is for AIX 3.2.3e, so we get the right libs at run time
    if test "z$thisver2" = "z3.2" ; then
		LIBPATH=/usr/lib:/lib
		export LIBPATH
    fi

    ;;

  IRIX*)
    exarch=sgi
    uiarch=sgi    

    remote=/usr/bsd/rsh

    if test "z$thisver" = "z5.1.1.1" ; then
      __SGI_NO_REMOTE_GL=1
      export __SGI_NO_REMOTE_GL
	fi

    unset XUSERFILESEARCHPATH
    export XUSERFILESEARCHPATH

    ;;

  SunOS*)
    # the version comes out as A.B.C - we want just A
    osver=`echo $thisver | sed -e '/.\..\../s/\..$//'`
    minorver=`echo $osver | sed -e 's/^.\.//'`
    majorver=$osver:r
    if test $majorver -ge 5 ; then
      exarch=solaris
      uiarch=solaris
      if test "$LD_LIBRARY_PATH" ; then
        LD_LIBRARY_PATH=$LD_LIBRARY_PATH":/usr/openwin/lib:/opt/SUNWits/Graphics-sw/xgl-3.0/lib:/usr/ucblib:/usr/local/lib"
      else
        LD_LIBRARY_PATH="/usr/openwin/lib:/opt/SUNWits/Graphics-sw/xgl-3.0/lib:/usr/ucblib:/usr/local/lib"
	  fi
      #
      # in Solaris 8 and higher, the inclusion of /usr/ucblib causes problems
      # with dx launching the exec programatically (probably similar to
      # the problem in SunOS4 below.
      #
      if test $minorver -ge 8 ; then
         LD_LIBRARY_PATH=`echo "$LD_LIBRARY_PATH" | sed -e 's?/usr/ucblib??g' -e 's?:[:]*?:?g'`
      fi
	  export LD_LIBRARY_PATH
    else
      exarch=sun4
      uiarch=sun4
      remote=/usr/ucb/rsh

      #
      # This is to work around a problem on SunOS4, in which a reference 
      # to a directory that is included by default causes
      # 'dlopen:stub interception failed' messages to appear when attempting
      # hw rendering.
      #
      if test "$LD_LIBRARY_PATH" ; then
        LD_LIBRARY_PATH=`echo "$LD_LIBRARY_PATH" | sed -e 's?/usr/ucblib??g' -e 's?/usr/lib??g' -e 's?:[:]*?:?g'`
        export LD_LIBRARY_PATH
      fi

    fi

    # make sure we don't use openwin files
    unset XFILESEARCHPATH
    export XFILESEARCHPATH

    ;;

  HP-UX*)
    exarch=hp700
    uiarch=hp700

    thisver=`uname  -m | cut -c1-6`
    remote=/usr/bin/remsh

    ;;

  dgux)
    exarch=aviion
    uiarch=aviion

    remote=/usr/bin/remsh

    ;;

  OSF1*)
    exarch=alphax
    uiarch=alphax

    ;;

  Linux)
    exarch=linux
    uiarch=linux

    remote=/usr/bin/rsh

    ;;

  CYGWIN*)
   exarch=cygwin
   uiarch=cygwin    
 
   remote=/usr/bin/rsh
 
   ;;

  Darwin*)
   exarch=macos
   uiarch=macos    
 
   remote=/usr/bin/rsh
 
   if [ -z "$DXMACROS" ]; then
      if [ -d "$HOME/Library/Application Support/OpenDX/macros" ]; then
         DXMACROS="$HOME/Library/Application Support/OpenDX/macros"
      fi
   else
      if [ -d "$HOME/Library/Application Support/OpenDX/macros" ]; then
         DXMACROS="$DXMACROS:$HOME/Library/Application Support/OpenDX/macros"
      fi
   fi
   if [ ! -z "$DXMACROS" ]; then
       export DXMACROS
   fi

   DX_WEB_BROWSER=1
   export DX_WEB_BROWSER

   ;;

  *)
    echo "unknown machine type"
    exit 1

    ;;
esac

DXARCH=$exarch
export DXARCH

# default to running locally, from /usr/lib/dx  
exhost=$thishost
dxroot=/usr/lib/dx
startup=1   # run the startup window by default


# initialize these so later they can be used, even the first time.
xparms=
dxargs=""
envargs=""
uiflags=""
prompterflags=""
exmdf=""
uimdf=""
errmsg=""
FileName=        # Name of filename given on command line w/o option
ScriptCmd=""       # Script command invocation to execute
uirestrict=""
echoparms=
seecomline=0
exlic=
motifcmd=
motifbind=
builder=0
encoder=0
tutor=0
prompter=0
exonly=0
uionly=0
wizard=0
exhilite=-B
uimode=-edit
exonly=0
exmode=-r
port=1900
cdto=`pwd`

#
# if DXARGS defined, use them as the default args to this command.
#  append any other command line args afterwards
#
if test "$DXARGS" ; then 
  dxargs="$DXARGS"
fi


# have to use all env variables here to set parms, because if we use rsh
#  to start dx on another machine, environment varsarwin*)  # The following is a work-around for a problem involved with NLS support
    # and .net file reading on AIX.
    #
    LANG=C
    LC_ALL=C
    export LANG
    export LC_ALL

    # this is for AIX 3.2.3e, so we get the right libs at run time
    if test "z$thisver2" = "z3.2" ; then
		LIBPATH=/usr/lib:/lib
		export LIBPATH
    fi

    ;;

  IRIX*)
    exarch=sgi
    uiarch=sgi    

    remote=/usr/bsd/rsh

    if test "z$thisver" = "z5.1.1.1" ; then
      __SGI_NO_REMOTE_GL=1
      export __SGI_NO_REMOTE_GL
	fi

    unset XUSERFILESEARCHPATH
    export XUSERFILESEARCHPATH

    ;;

  SunOS*)
    # the version comes out as A.B.C - we want just A
    osver=`echo $thisver | sed -e '/.\..\../s/\..$//'`
    minorver=`echo $osver | sed -e 's/^.\.//'`
    majorver=$osver:r
    if test $majorver -ge 5 ; then
      exarch=solaris
      uiarch=solaris
      if test "$LD_LIBRARY_PATH" ; then
        LD_LIBRARY_PATH=$LD_LIBRARY_PATH":/usr/openwin/lib:/opt/SUNWits/Graphics-sw/xgl-3.0/lib:/usr/ucblib:/usr/local/lib"
      else
        LD_LIBRARY_PATH="/usr/openwin/lib:/opt/SUNWits/Graphics-sw/xgl-3.0/lib:/usr/ucblib:/usr/local/lib"
	  fi
      #
      # in Solaris 8 and higher, the inclusion of /usr/ucblib causes problems
      # with dx launching the exec programatically (probably similar to
      # the problem in SunOS4 below.
      #
      if test $minorver -ge 8 ; then
         LD_LIBRARY_PATH=`echo "$LD_LIBRARY_PATH" | sed -e 's?/usr/ucblib??g' -e 's?:[:]*?:?g'`
      fi
	  export LD_LIBRARY_PATH
    else
      exarch=sun4
      uiarch=sun4
      remote=/usr/ucb/rsh

      #
      # This is to work around a problem on SunOS4, in which a reference 
      # to a directory that is included by default causes
      # 'dlopen:stub interception failed' messages to appear when attempting
      # hw rendering.
      #
      if test "$LD_LIBRARY_PATH" ; then
        LD_LIBRARY_PATH=`echo "$LD_LIBRARY_PATH" | sed -e 's?/usr/ucblib??g' -e 's?/usr/lib??g' -e 's?:[:]*?:?g'`
        export LD_LIBRARY_PATH
      fi

    fi

    # make sure we don't use openwin files
    unset XFILESEARCHPATH
    export XFILESEARCHPATH

    ;;

  HP-UX*)
    exarch=hp700
    uiarch=hp700

    thisver=`uname  -m | cut -c1-6`
    remote=/usr/bin/remsh

    ;;

  dgux)
    exarch=aviion
    uiarch=aviion

    remote=/usr/bin/remsh

    ;;

  OSF1*)
    exarch=alphax
    uiarch=alphax

    ;;

  Linux)
    exarch=linux
    uiarch=linux

    remote=/usr/bin/rsh

    ;;

  CYGWIN*)
   exarch=cygwin
   uiarch=cygwin    
 
   remote=/usr/bin/rsh
 
   ;;

  Darwin*)
   exarch=macos
   uiarch=macos    
 
   remote=/usr/bin/rsh
 
   if [ -z "$DXMACROS" ]; then
      if [ -d "$HOME/Library/Application Support/OpenDX/macros" ]; then
         DXMACROS="$HOME/Library/Application Support/OpenDX/macros"
      fi
   else
      if [ -d "$HOME/Library/Application Support/OpenDX/macros" ]; then
         DXMACROS="$DXMACROS:$HOME/Library/Application Support/OpenDX/macros"
      fi
   fi
   if [ ! -z "$DXMACROS" ]; then
       export DXMACROS
   fi

   DX_WEB_BROWSER=1
   export DX_WEB_BROWSER

   ;;

  *)
    echo "unknown machine type"
    exit 1

    ;;
esac

DXARCH=$exarch
export DXARCH

# default to running locally, from /usr/lib/dx  
exhost=$thishost
dxroot=/usr/lib/dx
startup=1   # run the startup window by default


# initialize these so later they can be used, even the first time.
xparms=
dxargs=""
envargs=""
uiflags=""
prompterflags=""
exmdf=""
uimdf=""
errmsg=""
FileName=        # Name of filename given on command line w/o option
ScriptCmd=""       # Script command invocation to execute
uirestrict=""
echoparms=
seecomline=0
exlic=
motifcmd=
motifbind=
builder=0
encoder=0
tutor=0
prompter=0
exonly=0
uionly=0
wizard=0
exhilite=-B
uimode=-edit
exonly=0
exmode=-r
port=1900
cdto=`pwd`

#
# if DXARGS defined, use them as the default args to this command.
#  append any other command line args afterwards
#
if test "$DXARGS" ; then 
  dxargs="$DXARGS"
fi


# have to use all env variables here to set parms, because if we use rsh
#  to start dx on another machine, environment varsarwin*)  # The following is a work-around for a problem involved with NLS support
    # and .net file reading on AIX.
    #
    LANG=C
    LC_ALL=C
    export LANG
    export LC_ALL

    # this is for AIX 3.2.3e, so we get the right libs at run time
    if test "z$thisver2" = "z3.2" ; then
		LIBPATH=/usr/lib:/lib
		export LIBPATH
    fi

    ;;

  IRIX*)
    exarch=sgi
    uiarch=sgi    

    remote=/usr/bsd/rsh

    if test "z$thisver" = "z5.1.1.1" ; then
      __SGI_NO_REMOTE_GL=1
      export __SGI_NO_REMOTE_GL
	fi

    unset XUSERFILESEARCHPATH
    export XUSERFILESEARCHPATH

    ;;

  SunOS*)
    # the version comes out as A.B.C - we want just A
    osver=`echo $thisver | sed -e '/.\..\../s/\..$//'`
    minorver=`echo $osver | sed -e 's/^.\.//'`
    majorver=$osver:r
    if test $majorver -ge 5 ; then
      exarch=solaris
      uiarch=solaris
      if test "$LD_LIBRARY_PATH" ; then
        LD_LIBRARY_PATH=$LD_LIBRARY_PATH":/usr/openwin/lib:/opt/SUNWits/Graphics-sw/xgl-3.0/lib:/usr/ucblib:/usr/local/lib"
      else
        LD_LIBRARY_PATH="/usr/openwin/lib:/opt/SUNWits/Graphics-sw/xgl-3.0/lib:/usr/ucblib:/usr/local/lib"
	  fi
      #
      # in Solaris 8 and higher, the inclusion of /usr/ucblib causes problems
      # with dx launching the exec programatically (probably similar to
      # the problem in SunOS4 below.
      #
      if test $minorver -ge 8 ; then
         LD_LIBRARY_PATH=`echo "$LD_LIBRARY_PATH" | sed -e 's?/usr/ucblib??g' -e 's?:[:]*?:?g'`
      fi
	  export LD_LIBRARY_PATH
    else
      exarch=sun4
      uiarch=sun4
      remote=/usr/ucb/rsh

      #
      # This is to work around a problem on SunOS4, in which a reference 
      # to a directory that is included by default causes
      # 'dlopen:stub interception failed' messages to appear when attempting
      # hw rendering.
      #
      if test "$LD_LIBRARY_PATH" ; then
        LD_LIBRARY_PATH=`echo "$LD_LIBRARY_PATH" | sed -e 's?/usr/ucblib??g' -e 's?/usr/lib??g' -e 's?:[:]*?:?g'`
        export LD_LIBRARY_PATH
      fi

    fi

    # make sure we don't use openwin files
    unset XFILESEARCHPATH
    export XFILESEARCHPATH

    ;;

  HP-UX*)
    exarch=hp700
    uiarch=hp700

    thisver=`uname  -m | cut -c1-6`
    remote=/usr/bin/remsh

    ;;

  dgux)
    exarch=aviion
    uiarch=aviion

    remote=/usr/bin/remsh

    ;;

  OSF1*)
    exarch=alphax
    uiarch=alphax

    ;;

  Linux)
    exarch=linux
    uiarch=linux

    remote=/usr/bin/rsh

    ;;

  CYGWIN*)
   exarch=cygwin
   uiarch=cygwin    
 
   remote=/usr/bin/rsh
 
   ;;

  Darwin*)
   exarch=macos
   uiarch=macos    
 
   remote=/usr/bin/rsh
 
   if [ -z "$DXMACROS" ]; then
      if [ -d "$HOME/Library/Application Support/OpenDX/macros" ]; then
         DXMACROS="$HOME/Library/Application Support/OpenDX/mac