OSF DCE Administration Guide--Core Components
OSF DCE Administration Guide—Core Components
of the spaces. Thus, all of the list elements appear as one argument. Similarly, we use
braces to enclose the individual elements in the script body.
Braces also help dcecp determine whether a command is complete; incomplete
commands will have more opening than closing braces. The lack of a closing brace at
the end of the first line signals dcecp that more command input is coming, so dcecp
prompts with the secondary prompt (>). Similarly, the opening brace at the end of line 2
signals that you are still not finished entering the command. This lets you wrap lines
without using a \ (backslash) line wrap character. The DCE control program executes
the command when you press <Return> after the closing brace at the end of line 3.
Chapter 2 contains more information about braces.
Now assume that, instead of six temporary workers, your organization has fifty
temporary workers (all in one group called temps) for whom you want to add three-
month account extensions. We’ll still use the foreach command but, rather than write all
fifty principals directly in the list, use the dcecp group list temps operation to generate a
list for you, as follows:
dcecp> foreach i [group list temps] {
> account modify $i -expdate 1996-06-30 }
dcecp>
In this example, we’ve put the group list temps operation in [ ] (brackets). Called
command substitution, this technique replaces the command inside the brackets with the
results returned by that command. The results of the group list temps operation
produces a valid Tcl list that might look like the following:
dcecp> group list temps
N_Long
L_Jones
P_Sawyer
D_Witt
M_Dougherty
S_Preska
.
.
.
J_Jones
Here, we’ve provided a high-level look at some practical uses of dcecp. Of course there’s
a lot we haven’t seen, too. In the next chapter we’ll look more closely at some of the
dcecp operations that you’re likely to use for DCE administration. Remember that
dcecp is based on Tcl, and Tcl has other commands and command variations we won’t
discuss. So be sure you have access to the standard Tcl publications for detailed
information on all of the commands.
1− 8 Tandem Computers Incorporated 124243