is an agent record that contains general information about the
environment (not in an ``environment variable'' sense) in which the
Glish script runs. It also generates events corresponding to changes
in the environment.
The predefined fields of system are:
- version
-
gives the version level of the Glish interpreter. Presently this field's
type is string, though it may change to double in the future to
facilitate inequality comparisons like ``system.version >= 2.1".
- is_script_client
-
is true (T) if the Glish script is being run as a script client
(§ 7.10, page
) and false (F) if not.
- print.limit
- allows the user to limit how much of Glish
values are output to the screen (see § 5.3.2, page
).
- print.precision
- allows the user to specify the number
of significant digits use to output floating point numbers (see
§ 5.3.1, page
).
- tk
- contains the Tk version number if Glish was
compiled with the Tk widgets (see § 10.8, page
).
- path.include
- path searched by include when attempting
to include a file (see § 4.14, page
).
- path.bin.host
- path searched when starting clients on
the machine host.
- output.pager.exec
- the executable to be started to handle
paging of output, e.g. less or more.
- output.pager.limit
- the number of lines where paging begins.
If set to 0 paging is always done, if set to -1 paging is
never done.
- output.log
- place to log input and output
(see § 8.2, page
).
- output.ilog
- place to log input (see § 8.2, page
).
- output.olog
- place to log output (see § 8.2, page
).
- output.pager.log
- place to log input and output
(see § 8.2, page
).
- pid
- process id of the current Glish
interpreter.
- ppid
- process id of the current Glish
interpreter's parent process.
- limits.max
- contains the maximum values for
Glish's builtin (non-boolean) numeric types.
- limits.min
- contains the minimum values for
Glish's builtin (non-boolean) numeric types.
The events generated by system are:
- connection_lost
-
indicates the loss of the network connection to a remote host. The
value of the event names the remote host. See § 14.2, page
for details
as to when this event is generated.
- connection_restored
-
indicates the restoration of the network connection to a remote host. The
value of the event names the remote host. See § 14.2, page
for details
as to when this event is generated.
- daemon_terminated
-
indicates that a remote glishd daemon terminated (normally this
indicates a problem or bug. See § 14.2, page
for details
as to when this event is generated.
For example, the following checkpoints some local data whenever the
network connection to the ``frontend'' host drops, and rolls
back to the checkpoint when connectivity resumes:
whenever system->connection_lost do
{
if ( $value == "frontend" )
do_local_checkpoint()
}
whenever system->connection_restored do
{
if ( $value == "frontend" )
roll_back_to_checkpoint()
}