|Skip Navigation Links|
|Exit Print View|
|System Administration Guide: Naming and Directory Services (NIS+)|
Existing table entries are edited (modified) using either the -e or -E options. The Solaris release also supports use of the -m option for backwards compatibility with earlier releases. (All new applications and command line operations should use either the -e or -E options.)
To edit an existing entry (row) in a table, use nistbladm with either the -e or -E options followed by one or more column=value pairs that specify the new values and ending with an indexed name that identifies a particular row in a table as described in nistbladm and Indexed NIS+ Names.
nistbladm [-e | -E] column="value" \ column="value" \ ... indexedname
When adding new entry rows to a table with either -e or -E:
Always enclose the value element in quotes. For example, to change the value of the cname column to deneb, the column=value pair would look like: cname="deneb".
You can only edit values in searchable columns one entry (row) at a time.
To specify that a column in the entry row that you are editing be empty, use column=" ". In other words, for the value, enclose a space between the quote marks.
The -e option edits an entry in a table unless doing so would result in changing values in searchable columns in more than one entry row, in which case it returns an error. (The values in non-searchable columns are not taken into account.)
nistbladm column="value" \ column="value" \ ... indexedname
To use the -e option, you only need to specify the column values you are changing.
For example, suppose you had the table:
To change the value of the Name column to Chandar, you would enter:
master% nistbladm -e Name="Chandar" [Dept='Sales',Site='SanFran'],\ depts.doc.com.
Now the table looks like this:
(Note that in the example above, the indexed name did not need to include the Name column because in these examples that column is not searchable.)
C-shell users should also use quotes to set off expressions using square brackets.
You can use the -e option to edit the values in searchable columns so long as the new values you specify affect only the single row identified by the indexed name. For example, to change the department to Manf, you would enter:
master% nistbladm -e Dept="Manf" [Dept='Sales',Site='SanFran'],\ depts.doc.com.
However, if an entry row already existed with Manf and SanFran in the searchable columns, the -e option would return an error.
You can specify changes to multiple columns so long as they all apply to a single entry row. For example, to change both the Dept and Name values, you would enter:
master% nistbladm -e Dept="Manf" Name=”Thi” \ [Dept='Sales',Site='SanFran'],depts.doc.com.
For example, suppose your table had the following rows:
Now you run the following command:
master% nistbladm -E Site="Alameda” Mgr="Chu" \ [Div='Sales',Site='SanFran'],depts.doc.com.
Which would change the Sales SanFran Chandar row to Sales Alameda Chu. But Sales Alameda are the key values identifying the Sales Alameda Achmed row, so that row would also be changed. The result would be a single row where once there had been two rows:
The -e option would have returned an error, since the edit would affect more than one row. But the -E option allows you to affect more than one entry row.