Previous: .dspackrc file
Up: Tutorial
Next: More Object Description Files
Previous Page: .dspackrc file
Next Page: More Object Description Files

Command line arguments

Envinronment variables may be set on the command line using the following syntax:

variable=value

There are several mechanisms in DSPACK to use the environment variables. Here is one example:

dspackrc_2 file

dspack.*.print             : dspackrc_2 file in $DSPACK_HOME/doc/tutorial
dspack.*.echo              : on
dspack.*.errors            : all

dspack.example_1.print : ********************************* dspack.example_1.print : * This is Example 1 (version 2) * dspack.example_1.print : ********************************* dspack.example_1.read : $tut_file dspack.example_1.end :

dspack.example_2.print : ********************* dspack.example_2.print : * This is Example 2 * dspack.example_2.print : ********************* dspack.example_2.echo : off dspack.example_2.read : $tut_file dspack.example_2.end :

This file will make DSPACK try to read the file pointed to by the environment variable tut_file. This file also demonstrates how different programs may be controlled from the same file by use of program name (example_1, example_2) - the user controls the name by an argument of dsinit call.

In the example below the value of tut_file is set on the command line.

Command line arguments

examples> setenv DSPACKRC ../dspackrc_2

examples> example_1 tut_file=dspack_tut_1.d dspackrc_2 file in $DSPACK_HOME/doc/tutorial ********************************* * This is Example 1 (version 2) * ********************************* DSPACK 1.130, 5 Jul 1994 * * ******************************************************************** * * * *$$ * dspack_tut_1.d DSPACK tutorial - example 1 * * * * * ******************************************************************** * DEFINE V3 R 0 ! A template for three real numbers "X component" x "Y component" y "Z component" z END DEFINE

DEFINE track_t S 1 ! define structure track_t, section 1 V3 start ! start position V3 p ! momentum V3 d ! position errors V3 dp ! momentum errors .REAL4 charge .REAL4 chisq .INT4 n_hits .INT4 flags(2) point_t *point_p ! pointer to first hit vertex_t *vertex_p ! pointer to vertex structure track_t *nextvt_p ! pointer to next vertex track END DEFINE DS_FIXPNT Warning: Void pointer: point_t DS_FIXPNT Warning: From: track_t DS_FIXPNT Warning: Void pointer: vertex_t DS_FIXPNT Warning: From: track_t

wwwd@na49
Fri Nov 4 01:54:15 MET 1994