OSF DCE Administration Guide--Core Components
OSF DCE Administration Guide—Core Components
2.4 Grouping Elements and Controlling Interpretation ....... 2-4
2.4.1 Grouping Elements with Braces .......... 2-5
2.4.2 Grouping Elements with Double Quotes ........ 2-5
2.4.3 Including Special Characters with Backslashes ...... 2-6
2.5 Documenting Scripts with Comments ........... 2-7
2.6 Convenience Variables ............... 2-8
2.6.1 Current Principal (User) Name (_u) ......... 2-8
2.6.2 Current Cell Name (_c) ............. 2-9
2.6.3 Current Host Name (_h) ............ 2-9
2.6.4 Most Recent Operation Argument Name (_n) ...... 2-10
2.6.5 Parent of _n (_p) ............... 2-10
2.6.6 Last dcecp Object Name (_o) ........... 2-11
2.6.7 Last Operation’s Return Value (_r) ......... 2-11
2.6.8 DCE Servers to Use (_s(xxx)) ........... 2-12
2.6.9 Last Security Server Used (_b(sec)) ......... 2-14
2.7 Measuring and Counting with Expressions .......... 2-14
2.8 Operating on Lists ................. 2-16
2.9 Controlling Scripts ................. 2-17
2.9.1 Conditionalizing with if Statements ......... 2-17
2.9.2 Controlling Script Execution with Loops ....... 2-18
2.9.3 Terminating Loops with continue and break ....... 2-20
2.9.4 Testing with Patterns Before Execution with case ..... 2-21
2.10 Creating Commands Dynamically ............ 2-22
2.11 Reading Other Files as dcecp Scripts ........... 2-23
2.12 Creating New Commands ............... 2-24
2.13 String Manipulation ................ 2-26
2.13.1 Constructing Strings .............. 2-27
2.13.2 Parsing Strings ............... 2-27
2.13.3 Other String Handling Operations .......... 2-28
2.14 Dealing with Errors and Exceptions ............ 2-29
2.14.1 Using Global Error Information Variables ....... 2-29
2.14.2 Using catch to Trap Errors and Exceptions ....... 2-30
2.14.3 Reissuing Complex Errors ............ 2-32
2.15 Working with Files ................. 2-32
2.15.1 Specifying Filenames ............. 2-33
2.15.2 Reading and Writing Files ............ 2-33
2.16 Spawning Subprocesses ............... 2-34
2.16.1 Running Operating System Commands from a
Script .................. 2-35
Chapter 3. Writing Scripts and dcecp Objects .............. 3-1
3.1 Informal Administration Scripts ............. 3-2
3.2 Formal Task Objects ................ 3-3
3.2.1 A Model for Task Objects ............ 3-4
3.2.2 Using the parseargs Procedure ........... 3-11
3.2.3 Invoking Task Objects ............. 3-13
iv Tandem Computers Incorporated 124243