OSF DCE Administration Guide--Core Components

DCE Control Program Introduction
1.5 When to Use an Interactive Command or Script
There’s no absolute dividing line for when you should enter commands interactively or
with a script. In general though, the simpler operations—those that perform one or
maybe two tasks—make the best candidates for interactive use. The following examples
typify interactive operations:
dcecp> directory create /.:/printers
dcecp> account show w_shakespeare
dcecp> server start /.:/hosts/curley/config/srvrconf/BBSserver
The next example is a little more complicated, so at first you might choose to run this as
a script:
foreach i [group list temps] {
account modify $i -expdate 1996-06-30}
Saving a frequently used operation as a script (in a file) has its advantages; it can help to
automate repetitive or complicated tasks and you can keep it around for possible
modification and use in other situations later on. Whichever method you choose, as you
become more comfortable using dcecp and Tcl, you might find yourself entering fairly
complex operations interactively. For information on how to how to create and invoke
scripts, refer to Section 1.8.
1.6 Editing Command Lines
We’ve seen some basic ways to enter interactive dcecp commands. But let’s say that
now you want to edit the command you’re entering or that you want to recall and modify
a command you entered previously. The DCE control program offers several ways to
edit commands. You can edit a current command line by using the command-line editing
facility. You can use the history command to recall, edit, and reissue a previously used
command.
1.6.1 Editing the Current Command Line
You can edit a command line before sending it to the dcecp by typing control characters
or escape sequences that resemble ksh or emacs editing commands. A control
character, shown as <Ctrl-x>, where x is a letter, is entered by holding down <Ctrl> (or
<Control>) and pressing the letter key. For example, <Ctrl-A> is <Ctrl> and <A>,
pressed at the same time. Enter an escape sequence by pressing <Escape> followed by
124243 Tandem Computers Incorporated 19