For recording environmental context, the tool labsetup is provided. It generates a resource file that contains information provided by the user in response to queries about certain commonly relevant environmental data. By default, this configuration file is called .labrc and is stored in the user's home directory. If such a file already exists, it will be modified according to the input provided and the old version of .labrc will be copied to .labrc.bak. Alternately, the user can indicate that a resource file, labrc should be created (or modified) in the current directory.
The tools use the information stored in such configuration
files, if present, to augment the data provided via the command line.
For options that may have a single value only,
data in the local labrc file has precedence over data in the global
file ($HOME)/.labrc
, and options given at the command line have
precedence over options provided in a configuration file. For options,
such as --cvs
for labrun, that may appear more than once on a
command line, the union of the option values from the command line and the
resource files, if any, is used by the tool.
Here is an excerpt from a sample run of labsetup showing how you can specify that the C compiler and its version should always be logged as well as the name of the graphics card being used.
labsetup session
labsetup, Revision 1.13, 2002/07/09 For all questions asked, the current value represented by existing ~/.labrc is displayed in square brackets after the question. If no value is set in ~/.labrc, the default value is shown in brackets. To keep the value shown, simply hit return. To reset a flag not corresponding to a yes-no question to the default use 'use default' as the input value. ---------------------------------------------------------------------- [...] Change settings for labrun? [y] y [...] Environment variables whose values should be noted Enter new values one per line. Use a '+' at the beginning of the first line to add to the current list; otherwise any new values given will replace the current ones. An empty line ends the input. [None] CC Additional comments to be recorded in log file Enter new values one per line. Use a '+' at the beginning of the first line to add to the current list; otherwise any new values given will replace the current ones. An empty line ends the input. [None] Compiler version=`$CC -v`:version Graphics card=`hinv`:Graphics\sboard [...]