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

Searching the First Column in NIS+

To search for a particular value in the first column of a table, simply enter the first column value and a tablename. In nismatch, the value must be a string. In nisgrep, the value must be a regular expression.

nismatch [-h] string tablename
nisgrep [-h] reg-expression tablename

This example searches through the depts table for all the entries whose first column has a value of R&D:

rootmaster% nismatch -h `R&D'
rootmaster% nisgrep -h `R&D'

Note –

Quotes are used in the 'R&D' expression above to prevent the shell from interpreting the ampersand (&) as a metacharacter.