ADC 400F Manual Pagina 47

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 74
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 46
Chapter 4. More information
specified by the DAQHOST environment variable, if it is defined, or localhost if not.
Consider the following script:
Example 4-3. Starting ReadoutShell ~/bin/startreadout
#!/bin/bash
. /etc/profile
. ~/.bashrc
if test "$DAQHOST" == ""
then
host=‘hostname‘ #
else
host="$DAQHOST"
fi
/usr/opt/daq/8.1/bin/ReadoutShell -host=$host \
-path=$HOME/experiment/readout/Readout #
Ê This shell script code checks to see if the environment variable DAQHOST is undefined or blank. If
so, then the shell script variable host is set to the name of the system the script is running on
(Readout will be run locally). If not, host is set to the value of the DAQHOST variable.
Ë These two lines start the ReadoutShell GUI telling it to run the readout program we created on the
host specified by the host variable.
The readout application we wrote does not need to know what its working directory is, it also does not
rely on any environment variables that got set by either the system wide, or user profile scripts
(/etc/profile, and ~/.bashrc). It is possible that you might write a readout program that does rely
on knowing the working directory, the value of an environment variable or both. In that case, instead of
directly running the readout program, as shown in the example above, specify that the readout program is
itself a shell script that will source the appropriate profiles and set the appropriate working directory.
42
Vista de pagina 46
1 2 ... 42 43 44 45 46 47 48 49 50 51 52 ... 73 74

Comentarios a estos manuales

Sin comentarios