System Administration Guide: Naming and Directory Services (NIS+)

Editing an NIS+ Table Entry With the -e Option

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:

Dept 

Site 

Name 

Sales 

SanFran 

Tsosulu 

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:

Dept 

Site 

Name 

Sales 

SanFran 

Chandar 

(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.

Dept (searchable) 

Site (searchable) 

Name 

Manf 

SanFran 

Chandar 

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.

Dept (searchable) 

Site (searchable) 

Name 

Manf 

SanFran 

Thi