Sun N1 Service Provisioning System 5.1 Command-Line Interface Reference Manual

Redirecting Output to a File

To redirect command output to a file, you can either use the -of argument or use a shell redirect. The argument to the -of argument is a full path to a file.

For example, this command writes the output to a file called hostFile. Note that the -of argument must immediately follow the command specified by -cmd.


cr_cli -cmd hdb.h.add -of hostFile -u user-name
-p password -name myhost -tID NM:system#crhost

After the command is run, hostFile contains output in detail format, which is the default output format for the hdb.h.add command.

Another example of redirecting output to a file involves using a stored session ID to authenticate commands. First, save the RPC-serialized representation of the session ID to a file called session. You can redirect this output to a file using either method.

Once you have stored your session ID in a file, you can use the file as input to another command. See Reading Input From a File.