The command sgrep is used to find a given string in the file, and output the line and line number of the string

topic

The command sgrep is used to search for a given string in the file and output the line and line number of the string.
The command format is: sgrep [-i] filename string
where:
-i means case is not relevant when searching, and when omitted, it means case-related filename. Given file name
string, the string to be searched for is
implemented in C language. The program should have Certain error handling capabilities. (Hint: Use command line parameters)
Note: Except for file and I/O operations that can use library functions, library functions are not allowed.

Code (source code click here)

Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here

Guess you like

Origin blog.csdn.net/honeylife/article/details/101059803