OSF DCE Administration Guide--Core Components
OSF DCE Administration Guide—Core Components
3.1 Informal Administration Scripts
Informal administration scripts let administrators store multiple operations in a file and
replay them whenever necessary. Informal scripts are useful for operations that take only
one or two arguments or that just perform simple tasks. Furthermore, the script’s precise
behavior and output can be custom tailored to the needs of its author. While informal
scripts can be shared among administrators in a cell, they are typically included just in
the author’s .dcecprc file.
Scripts generally consist of one or more procedures created with the proc command.
This lets you invoke the scripted operation by simply typing the procedure’s name at the
dcecp prompt.
The following simple script prints information about your current cell and login identity:
# Show your current login name and your current cell name.
proc _dcp_whoami {} {
global _c _u
puts stdout "You are ’$_u’ logged into ’$_c’."
}
This script can be included in your .dcecprc file either directly or by using the source
command and keeping the actual script in an external file. The second method lets other
administrators include your same script by simply pointing to it with source commands
in their .dcecprc files. This method also keeps your .dcecprc file uncluttered, making it
easier for others to understand what is going on. Alternatively, you can place the script
or a pointer in the init.dcecp file. Changes to this file are available to all users on a host.
For more information about the init.dcecp file and the .dcecprc file, see Section 1.8 of
Chapter 1. The following is an example of the source command in a .dcecprc file:
source /usr/users/wardr/dcecp/local_lib.dcp
The .dcp filename extension is a convention for naming files used by the DCE control
program. Another convention precedes procedure names with _dcp,asin
_dcp_whoami. Many dcecp procedures adhere to this convention to distinguish their
names from user-created procedures that do not need to use this convention. If you find
procedure names like _dcp_whoami hard to remember or type, you can rename them.
For instance, you could rename the procedure to whoami by using the rename command
in the .dcecprc file, as follows:
rename _dcp_whoami whoami
Restart dcecp to pick up any changes. Now you can enter whoami at the DCE control
program prompt, as follows:
dcecp> whoami
You are ’cell_admin’ logged into ’/.../my_cell.goodco.com’.
dcecp>
3− 2 Tandem Computers Incorporated 124243