4 Environment Variables

catremote takes some input from Unix shell environment variables and these variables can be used to control its behaviour. Some of the variables are optional, but others are mandatory and must be set before catremote is invoked. The variables used are listed in Table 1 and described briefly below.


Variable Default Description



CATREM_URLREADER Program to submit query
CATREM_CONFIG URL of configuration file
CATREM_MAXOBJ 1000 Maximum number of objects in results table
CATREM_ECHOURL no Echo URL sent to remote server?

Table 1: Environment variables used by catremote. The variables for which no default is given are mandatory

CATREM_URLREADER
catremote uses a separate program to submit the URL constituting a query to the server and return the table of results. The options available are described in Section 9.
CATREM_CONFIG
specifies the configuration file to be used. It should be set to either the URL (for a remote file) or the local file name, including a directory specification (for a local file). Configuration files are described in SSN/75[3]. The default configuration file used by CURSA is at URL:
CATREM_MAXOBJ
is the maximum number of objects which the returned table is allowed to contain.
CATREM_ECHOURL
Controls whether the URL representing the query submitted to the remote server is also displayed to the user. The default is ‘no’; to see the URL set CATREM_ECHOURL to ‘yes’. Seeing the URL is potentially useful when debugging configuration files and servers but is not usually required for normal operation.

These environment variables are set up automatically when CURSA is started. However, if catremote is being used outside CURSA they need to be set up manually. Figure 1 shows an example script for this purpose. On Starlink systems it is available as file:

  /star/share/cursa/cursacatremote-setup.csh


  #! /bin/csh -f
  #+
  # catremote-setup.csh
  #
  # Example shell script to setup the environment variables used by
  # catremote.  Note that this file should be sourced.
  #
  # Author:
  #   A C Davenhall (Edinburgh)
  # History:
  #   23/5/01 (ACD): Original version.
  #-
  
  #  Define the utility program to be used to submit the query.  The options
  #  are:
  #    "/star/bin/cursa/geturl" -- geturl utility,
  #    "lynx -source"           -- lynx command line browser,
  #    "java  UrlReader"        -- Java utility.
  #    "wget -q -O -"           -- wget utility (probably RedHat Linux only).
  
  setenv  CATREM_URLREADER "/home/acd/starbase/cursa/catremote/geturl/geturl"
  
  #  Specify the configuration file to be used.  The URL given here is the
  #  the CURSA default.
  
  setenv  CATREM_CONFIG  http://dev.starlink.ac.uk/~pwd/catremote/cursa.cfg
  
  #  Define the maximum number of objects which may be included in the
  #  returned table.
  
  setenv  CATREM_MAXOBJ  200
  
  #  Specify whether the URL constituting the query is echoed to the
  #  command line.  The options re:
  #    no   -  do not echo the URL (default),
  #    yes  -  echo the URL.
  
  setenv  CATREM_ECHOURL no
  
  #  Set the Java CLASSPATH environment variable to pick up the URLreader
  #  (note that CLASSPATH has to be set rather than setting the corresponding
  #  command line option because the latter does not work on alphas).
  
  setenv CLASSPATH /home/acd/starbase/cursa/catremote:/usr/lib/netscape/java/classes


Figure 1: Example shell script to set up catremote environment variables