Sun N1 System Manager 1.3 Command Line Reference Manual

Command Line Interface Tips

This section contains a few tips to help you use the N1 System Manager CLI.

General Syntax

The general syntax for an N1 System Manager command is:


command object [object-value] [object [object-value]]* [attribute[=][attribute-value]]*

For simplification purposes, the attribute term is usually used to describe both objects and keywords.

User-Defined Names

User-defined names, such as OS profile or group names, may include numbers, letters, and some special symbols. The following special symbols are prohibited: comma, asterisk, single quotes, double quotes, parenthesis, question mark, equal sign, and newline.

id Keyword

The id keyword is an optional keyword that can be used on the N1 System Manager CLI before some attribute values, typically for the server attribute value. The purpose of this keyword is to allow the use of an attribute value that is the same name as a reserved keyword (for example, a server named upgrade).

Equal Sign

The equal sign (=) can be used between attribute names and attribute values on the N1 System Manager CLI. For example, the following commands are equivalent:


N1-ok> set role MyRole description myDescription
N1-ok> set role MyRole description=myDescription

The equal sign variant is not shown in the CLI help.

Script Comments

When creating a customized n1sh script, you can specify the comment character (#) at the beginning of the line to indicate that the rest of the line should be ignored. See To Run a Script of N1 System Manager Commands in Sun N1 System Manager 1.3 Discovery and Administration Guide for more information.

Multiple Attribute Values

Where allowed, multiple attribute values can be specified as a comma–separated list on the N1 System Manager command line. For example:


N1-ok> set server serverA,serverB,serverC locator on

In the CLI help, multiple attribute values are shown using the following syntax notation: set server <server>[,<server>...]


Note –

Spaces are not allowed between commas.


Quotation Marks

Single and double quotation marks are supported in the n1sh shell mode. If needed, either type of quotation mark can be escaped using the backslash character. For example:


N1-ok> set role myRole description "Some Role that I've made up"
N1-ok> set role myRole description='Some Role that I\'ve made up'

Special Characters in UNIX Command Mode

Depending on the shell you are using to run n1sh in UNIX command mode, some special characters may need to be escaped. For example, in the bash shell, quotation marks need to be escaped with the backslash character, like this:


$ n1sh set role MyRole description=\"Some Role that \\\"Paul\\\" made up\"

Or, you can use single quotation marks to escape double quotation marks:


$ n1sh set role MyRole description='"Some Role that \\"Paul\\" made up"'

See your specific shell's documentation for more information about escaping special characters.

In the n1sh shell mode, you do not have to escape special characters, so the same command described above would appear as follows:


N1-ok> set role MyRole description="Some Role that \"Paul\" made up"

Hiding Passwords

You can type a question mark (?) for any password attribute value if you do not want the password to display in the command line. Once you issue the command, you are prompted for the password. Examples include the rootpassword and agentssh attributes.