PreviousNext

Invoking dcecp Operations

If you are performing a single dcecp operation, you can invoke it directly from your operating system prompt. Just precede the desired operation with the dcecp command and the-c (command line operation) argument at the operating system prompt:

% dcecp -c directory list /.:/subsys -simplename
HP applications dce sales eng admin accts
% dcecp -c cell show
{secservers
/.../my_cell.goodco.com/subsys/dce/sec/master}
{cdsservers
/.../my_cell.goodco.com/hosts/krypton}
{dtsservers
/.../my_cell.goodco.com/hosts/mars}
{hosts
/.../my_cell.goodco.com/hosts/earth
/.../my_cell.goodco.com/hosts/jupiter
/.../my_cell.goodco.com/hosts/kyrpton
/.../my_cell.goodco.com/hosts/mars
/.../my_cell.goodco.com/hosts/mercury
/.../my_cell.goodco.com/hosts/neptune
/.../my_cell.goodco.com/hosts/pluto
/.../my_cell.goodco.com/hosts/saturn
/.../my_cell.goodco.com/hosts/uranus
/.../my_cell.goodco.com/hosts/venus}
%

You can also enter some limited multiple operations using the semicolon (;) as a command separator and enclosing the operations in double quotes. The following example adds a principal to the registry and then checks that the principal is added.

%dcecp -c "principal create S_Preska ; principal show S_Preska"
{fullname {}}
{uid 28}
{uuid 0000001c-dc77-21cd-b700-0000c08adf56}
{alias no}
{quota unlimited}
%

Be careful entering multiple operations using the dcecp command with the -c option because operation results return to the dcecp interpreter, not to the shell. An operation like the following returns the results of just the last operation (group list users) to the shell.

% dcecp -c "group list staff; group list managers; group list users"
/.../ward_cell.osf.org/P_Pestana
/.../ward_cell.osf.org/R_Parsons
/.../ward_cell.osf.org/L_Jones
/.../ward_cell.osf.org/S_Preska
/.../ward_cell.osf.org/N_Long
/.../ward_cell.osf.org/D_Witt
/.../ward_cell.osf.org/C_Pilat
.
.
.
%

This particular problem can be overcome by:

% dcecp -c "puts [group list staff]; puts [group list managers]; puts [group list users]"
.
.
.
%

To invoke a dcecp script, omit the -c argument but include the name of the script. The following example invokes a script that lists the names of all hosts in the cell in alphabetical order.

% dcecp list_hosts
earth
jupiter
krypton
mars
mercury
neptune
planets
pluto
saturn
uranus
venus
%

When you want to invoke complex or multiple operations, you might want invoke operations from within the dcecp program. The program provides a convenient history facility and a command line editing capability that is useful for recalling and reusing previous operations. The following example operations invoke the dcecp program and add a new user to a DCE cell.

%dcecp
dcecp> principal create J_Jones
dcecp> group add users -member J_Jones
dcecp> organization add staff -member J_Jones
dcecp> account create J_Jones -group users -organization staff \
> -password change.me -mypwd mxyzptlk
dcecp>

All dcecp object, operation and option names can be abbreviated to the shortest unique string when used interactively. These names have been chosen with this in mind so that unique abbreviation are usually not more than one or two characters.

Avoid using object or command abbreviations within scripts as this limits a script's portability. Users defining their own commands could alter the uniqueness of abbreviations, resulting in ambiguous command names or object names.