This repository has been archived on 2021-08-17. You can view files and clone it, but cannot push or open issues or pull requests.
unix/mygrep
Ivaylo Ivanov 712e3910ad Fix bug in client and change the Makefiles 2018-11-10 21:18:12 +01:00
..
Makefile Fix bug in client and change the Makefiles 2018-11-10 21:18:12 +01:00
README.md Implement check for user input and file data, add file append 2018-10-07 12:19:47 +02:00
mygrep.c Add initial server functionality and clean up 2018-11-06 19:45:29 +01:00

README.md

mygrep

A reduced variation of the Unix-command grep. It reads in several files and prints all lines containing a keyword.

SYNOPSIS
mygrep [-i] [-o outfile] keyword [file...]

The program mygrep reads files line by line and for each line checks whether it contains the search term keyword. The line is printed if it contains the keyword, otherwise it is not printed. The program accepts lines of any length.

If one or multiple input files are specified (given as positional arguments after keyword), then mygrep reads each of them in the order they are given. If no input file is specified, the program reads from stdin.

If the option -o is given, the output is written to the specified file (outfile). Otherwise, the output is written to stdout.

If the option -i is given, the program does not differentiate between lower and upper case letters, i.e. the search for the keyword in a line is case insensitive.

Note: The description is from the task I got from TU.