This is a 2-step process:
For UNIX/Linux
==============
First, prepare 2 files:
# more inputfile
. nsr client
print
#
# more patternfile
name
policy
save set
#
#
Then run this command:
# /usr/xpg4/bin/grep -f patternfile outputfile
name: abc;
browse policy: Month;
retention policy: Year;
save set: /usr, /etc, /nsr;
name: def;
browse policy: Month;
retention policy: Year;
save set: All;
#
######################################################
For Windows, it is a similar issue:
C:\>copy con: inputfile
. nsr client
print
^Z
1 File(s) copied.
C:\>
C:\>nsradmin -i inputfile > outputfile
C:\>
C:\>findstr "name policy save" outputfile
name: xyz;
browse policy: Month;
retention policy: Year;
save set: All;
C:\>
The only problem is that this simple method does not separate each client (by an empty line).