PreviousNext

Convenience Variables

All dcecp commands set several variables on execution. The variables contain the name of the object operated on, the return value of the last command, the cell name of the last object operated on, and so on. To avoid unnecessary typing, you can substitute the value of these variables into the next command.

Convenience variables behave just like other variables in dcecp. Thus you can trigger variable substitution by prepending a dollar sign ($) before the name of the variable. Alternatively, you can trigger substitution by using set. The convenience variables can be set only by using the DCE control program.

The dcecp program defines the following variables:

_b
Holds the name of the server bound to for the last command. This is actually a Tcl array where the indexes are used to identify the service. Currently there is only one defined index: sec.

The value specifies the name of a server in whatever manner the service finds useful. This could be the name of an RPC server entry in the namespace, or a string binding, or the name of a cell. This variable may not be set by the user.

_c
Holds the cellname of the current principal. The login command sets the cell name (_c) and principal name (_u) convenience variables at login (see the login command). You can set this variable to change the current login context command.

_conf
This variable alters the behavior of most commands that operate on a CDS object. It indicates the confidence you have in the local CDS daemon to fulfill requests. The legal values are low, medium, and high.

_e
Holds the last DCE error code encountered. This variable has meaning only if dcecp is able to determine what the error code is. The value -l is used when an actual error code is unavailable. This variable can be set by the user.

-h
Holds the host name the current user is operating on. This variable cannot be set by the user.

_local
Holds a flag that indicates the mode in which the dcecp session is operating. This variable is set to true if the dcecp session was started with the -local option.

_n
Holds a list of the names entered to the last command. These names are the names that the command operated on, typically entered as the third argument.

For example, the following command lists the simplenames of the directories in the .: directory:

dcecp> dir list /.: -simplename
hosts subsys absolut_ch cell-profile fs lan-profile sec \
sec-v1
dcecp>

The _n variable then contains the following name:

dcecp> echo $_n
/.:
dcecp>

The following command creates the /.:/x and /.:/y directories:

dcecp> dir create {/.:/x /.:/y}
dcecp>

The _n variable then contains the following names:

dcecp> echo $_n
/.:/x /.:/y
dcecp>

_o
Holds the object used in the last operation. For example, if the last command was dir show /.:, then _o is directory. This variable cannot be set by the user.

_p
Holds the parent of _n. If _n is a list, then this is a list of the same length, where each element is the parent of the corresponding element in _n. If -n has no parent, then the value of _p is the empty string. This variable cannot be set by the user.

The following example creates the directories named /.:/gumby and /.:/pokey. When the command completes the _n variable contains the names gumby and pokey.

dcecp> dir create {/.:/gumby /.:/pokey}
dcecp>

The _p variable contains the names of the parents of the gumby and pokey directories.

dcecp> echo $_p
/.: /.:
dcecp>

_r
Holds the return value of the last executed command. This variable cannot be set by the user.

_s
Holds the name of the server bound to for the last command. This is actually a Tcl array where the indexes are used to identify the service. The currently defined indexes are: sec, cds, dts, and aud.

The value specifies the name of a server in whatever manner the service finds useful. This could be the name of an RPC server entry in the namespace, or a string binding, or the name of a cell. Users can set this variable by issuing the set command to select the server to use.

The values of this variable (array) are treated differently by each service. For example, the security service uses this variable to select the registry to bind to for the next command, and as a default for the next registry operation. If bound to a read-only replica and an update is requested, dcecp tries to bind to the master registry to perform the change. The CDS service only attempts to communicate with the CDS server named by the variable. If the named CDS server cannot satisfy a request for any reason, the request fails. The auditing service and DTS uses its variable in a similar manner to the CDS server. To contact an audit daemon or DTS server on another host, set this variable to identify that server.

For information about an object's use of this variable, see the object's reference page or use the object's help -verbose operation.

_u
Holds the current principal name. The login command sets the cell name (_c) and principal name (_u) convenience variables at login (see the login command). This variable cannot be set by the user.