Technical References

executing the set of scope commands in the scope.txt file in the previous example, you might want to
ensure that the cluster is locked.
# Quit if cluster cannot be locked
session assert locked
Command Syntax
When you execute nrcmd commands that contain equal-signs, you must put them within quotation
marks. For example, to use a single command to create a client-class name, enter:
nrcmd -C cluster -N name -P password "client MAC create client-class-name= name "
Adding Program Control
A more sophisticated method for automatically configuring and controlling Network Registrar is to have
a program or script start a nrcmd session and communicate with the session through standard input
and output.
To control nrcmd from another program, you need to start nrcmd from the controlling program and
redirect standard input and output from nrcmd to file handles in the controlling program. The controlling
program can then write commands to the input file handle and read results from the output file handle.
When running in batch mode, nrcmd reads a line of input at a time and prints a new line after the
prompt. This provides an easily parsed sequence of lines in response to any command where:
The syntax is status-line result-lines prompt-line
The status-line has the format [0-9]{3} .*.
There may be zero or more result-lines of any format.
The prompt-line is nrcmd> .
The exact details of starting up nrcmd as a child process, and writing to and reading from its standard
input and output, are specific to the programming language you use to implement the controlling
program.