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' depts.doc.com. rootmaster% nisgrep -h `R&D' depts.doc.com. |
Quotes are used in the 'R&D' expression above to prevent the shell from interpreting the ampersand (&) as a metacharacter.