OSF DCE Administration Guide--Core Components
Using the DCE Control Program Command Language
The choice to use braces or quotes to group elements together depends on how you want
dcecp to interpret special characters like $, [, and {. While braces disable special
interpretation of most of these characters, double quotes disable special interpretation of
just a few. The backslash character, discussed in Section 2.4.3, offers another way to
disable interpretation of special characters. When used together, braces, quotes, and
backslashes offer lots of flexibility in composing dcecp command strings.
2.4.1 Grouping Elements with Braces
Braces group separate elements to create a new element that consists of everything
between a { (left brace) and its corresponding } (right brace). You can also nest braced
elements. Each of the following example lists contain three elements:
larry moe curly
1{3571113}{1719}
red {orange yellow {green blue} indigo} violet
Braces disable command ([ ]), variable ($), and backslash substitution. While the most
important use of braces is to ensure a dcecp command has the correct number of
arguments, this also provides a convenient way to include special characters in a list. To
see how this works, consider the following example:
dcecp> set a solution
solution
dcecp> puts $a
solution
dcecp> puts {This is a convenient $a}
This is a convenient $a
While the puts command is often used for writing to files, when called with only one
argument it writes the argument to stdout. In our example, the first use of puts allows
normal interpretation of the variable a. The second use of puts groups the separate
elements into one argument by disabling special interpretation of space characters and
the dollar sign.
2.4.2 Grouping Elements with Double Quotes
Like braces, double quotes also group elements together. But unlike braces, double
quotes cannot be nested. Furthermore, while braces disable almost all special characters,
double quotes disable just a few—spaces, tabs, newlines and semicolons— letting you
avoid the potentially awkward use of backslashes in a string of text elements. The most
convenient use of double quotes is to allow clean, readable expansion of variables using
the dollar sign trigger. For instance, in the following example we set a variable (a)to a
124243 Tandem Computers Incorporated 2−5