OpenTP1 Version 7 System Definition

[Contents][Index][Back][Next]

1.4.2 Notational formats

Organization of this subsection
(1) set format
(2) Command format
(3) putenv format
(4) dcputenv format
(5) Comments
(6) Rules
(7) Cautions when establishing environment variables

(1) set format

A definition specified in the set format is called an operand. The set format establishes a value for an operand as follows.

set operand=value

(2) Command format

A definition specified in the command format is called a definition command. The command format establishes the option and argument as follows.

command-name option command-argument

command-name is the command name.

option is a character string starting with a hyphen, and can be in format 1 with no argument, or format 2 with a required argument, as follows:
Format 1
-option-flag
Format 2
-option-flag flag-argument
Legend:
option-flag is a single alphanumeric character following a hyphen; the alphabetic character must be in lowercase. flag-argument is a character string subtending to an option flag.

command-argument is an argument starting with any character other than a hyphen. It identifies the operation of the command.

(3) putenv format

The putenv format establishes the user's environment variables as follows. When an environment variable name is specified in the environment variable value operand, the environment variable is not extended.

putenv environment-variable-name environment-variable-value

(4) dcputenv format

The dcputenv format establishes the user's environment variables as follows. When an environment variable name is specified in the environment variable value operand, the environment variable is extended and the extended value is set as the user's environment variable.

dcputenv environment-variable-name environment-variable-value

(5) Comments

Any comment must be preceded by a hash mark (#). This symbol notated at the start of a line renders that whole line to be treated as a comment. Thus a comment can be of two formats:

Format 1

definition # comment

Format 2

# comment

(6) Rules

In a definition consisting of multiple items separated by a comma (,), do not place a space before or after a comma.

The values for the maximum length of each definition line are shown below.

If the specification exceeds the maximum length of each line, startup of OpenTP1 may fail or an error message may be issued.

If a definition is longer than the maximum length, write the definition on multiple lines by appending a continuation symbol (\) to each line that will be followed by a continuation line. Do not specify anything after the continuation symbol (\). When specifying multiple items separated by commas (,) on multiple lines, specify a comma (,) after the last item on the line on which a continuation symbol (\) is specified.

In the network communication definition, be careful when you specify an option with an operand enclosed in double quotation marks (") and the option is followed by another option on the next continuation line. In such a case, place at least one space character between the right quotation mark and the continuation symbol (\) on the first line, as shown in the example below. In the example, [Figure] indicates a space character.

-y "mode=client"[Figure]\
-r "portno=10002"

(7) Cautions when establishing environment variables

In the dcputenv format, the getenv function extends an environment variable name specified in the environment variable value operand. Any environment variable name must be preceded by a dollar sign ($). Alphanumerics and underscores can be specified in environment variable names.

Notes on specifying an environment variable value that includes an environment variable name:
  • If the value of an expanded environment variable contains an environment variable name, the environment variable name is not expanded.
  • To treat the environment variable name contained in an environment variable value as a character string, enclose the entire value in double quotation marks (").
  • Double quotation marks (") included in an environment variable value are treated as part of the value.

Example:When the /OpenTP1 directory is specified in the environment variable $DCDIR
 
putenv TMPPATH $DCDIR/tmp                  1
dcputenv FILEPATH $DCDIR/tmp               2
dcputenv TEMPDIR $TMPPATH/file             3
dcputenv REALPATH $FILEPATH:$DCDIR/file    4
dcputenv ENVPATH "$TMPPATH/file"           5
dcputenv DIRTMP $DCDIR:"$FILEPATH":/tmp    6
 
  1. The character string "$DCDIR/tmp" is set in TMPPATH ($DCDIR is not expanded).
  2. "/OpenTP1/tmp" is set in FILEPATH ($DCDIR is expanded to "/OpenTP1").
  3. "$DCDIR/tmp/file" is set in TEMPDIR ($TMPPATH is expanded to "$DCDIR/tmp/", however $DCDIR is not expanded).
  4. "/OpenTP1/tmp:/OpenTP1/file" is set in REALPATH (when $FILEPATH: is specified, the character string up to the colon (excluding the colon) is recognized as an environment variable name).
  5. "$TMPPATH/file" is set in ENVPATH ($TMPPATH is not expanded).
  6. /OpenTP1:"/OpenTP1/tmp":/tmp is set in DIRTMP. The double quotation marks are also set because they are treated as part of the environment variable value. Since these double quotation marks are not treated as quotation marks preventing the expansion of an environment variable name, $FILEPATH is expanded.

If the same environment variable is specified in both the putenv and dcputenv formats, the last specified one becomes valid.