Searching for Patterns in Files - kgrep

This is the Korn shell version of the Unix grep command. The –b option is not supported, and the –i flag causes multi-character expressions to be matched in both all upper-case or all lower-case (kgrep –i AbC test matches AbC, abc, or ABC in test, but not aBc or other permutations). Here are the supported options:

–c display the number of lines that contain the given pattern
–i ignore case of letters during comparison (see above)
–l display only names of files with matching lines once
–n display the output with line numbers
–s do not display error messages
–v display all lines, except those that match the given expression
					#!/bin/ksh
					#
					#      kgrep - Korn Shell grep program
					#
					# Declare default flags
					CFLAG= ...

Get Korn Shell: Unix and Linux Programming Manual, Third Edition, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.