On the Solaris operating system, nismatch and nisgrep are utilities for searching NIS+ tables.
Description
The utilities nismatch and nisgrep can search NIS+ tables. The command nisgrep differs from the nismatch command in its ability to accept regular expressions keypat for the search criteria rather than simple text matches.
- Description
- Syntax
- Environment
- Examples
- Related commands
- Linux commands help
Because nisgrep uses a callback function, it is not constrained to searching only those columns that are specifically made searchable at the time of table creation. This makes it more flexible, but slower, than nismatch.
In nismatch, the server does the searching, whereas in nisgrep, the server returns all the readable entries, and then the client does the pattern-matching.
In both commands, the parameter tablename is the NIS+ name of the table to be searched. If only one key or key pattern is specified without the column name, then it is applied searching the first column. Specific named columns can be searched using the colname=key syntax. When multiple columns are searched, only entries that match in all columns are returned. This is the equivalent of a logical join operation.
nismatch accepts an additional form of search criteria, indexedname, an NIS+ indexed name of the form:
[ colname=value, … ],tablename
Syntax
nismatch [-AchMoPv] [-s sep] key tablename
nismatch [-AchMoPv] [-s sep] colname = key… tablename
nismatch [-AchMoPv] [-s sep] indexedname
nisgrep [-AchiMov] [-s sep] keypat tablename
nisgrep [-AchiMov] [-s sep] colname = keypat… tablename
Options
Environment
If the NIS_PATH environment variable is set, and the NIS+ table name is not fully qualified, each directory specified is searched until the table is found (see nisdefaults).
Examples
nismatch name=skippy passwd.org_dir.zotz.com.
Searches a table named passwd in the org_dir subdirectory of the zotz.com. domain. It returns the entry with the username of skippy. All the work is done on the server.
nisgrep ‘shell=[ck]sh’ passwd.org_dir.zotz.com.
Like the example above, except instead of searching the passwd table for a user named skippy, it searches the table for users whose default shell is either csh or ksh.
Related commands
niscat — Display NIS+ tables and objects.nisdefaults — Display NIS+ default values.nistbladm — Administer NIS+ tables.