Question: Please submit an algorithm (in pseudocode or plain English) together with your source code which at least should pass compiling. The uniq shell utility imitation

- Please submit an algorithm (in pseudocode or plain English) together with your source code which at least should pass compiling.
The uniq shell utility imitation Using the system calls we have discussed so far, develop your own version of the uniq shell utility. The man pages describe uniq as: NAME uniq - report or omit repeated lines SYNOPSIS uniq (OPTION)... [INPUT (OUTPUT]] DESCRIPTION Filter adjacent matching lines from INPUT (or standard input), writing to OUTPUT (or standard output). With no options, matching lines are merged to the first occurrence. The info pages are a little more explanatory: 7.3 'uniq': Uniquify files 'uniq' writes the unique lines in the given 'input', or standard input if nothing is given or for an INPUT name of'. Synopsis: uniq (OPTION)... [INPUT (OUTPUT]] By default, 'uniq' prints its input lines, except that it discards all but the first of adjacent repeated lines, so that no output lines are repeated. Optionally, it can instead discard lines that are not repeated, or all repeated lines. The input need not be sorted, but repeated input lines are detected only if they are adjacent. In your version of unig, the program can act as a filter (input from stdin, output to stdout) or you can pass the name of the file to be processed via the command line. The code can be written in 'C' or 'C++, but only system calls can be used to process the file. Example Given the file hello Goodbye Goodbye hello hello The uniq shell utility imitation Using the system calls we have discussed so far, develop your own version of the uniq shell utility. The man pages describe uniq as: NAME uniq - report or omit repeated lines SYNOPSIS uniq (OPTION)... [INPUT (OUTPUT]] DESCRIPTION Filter adjacent matching lines from INPUT (or standard input), writing to OUTPUT (or standard output). With no options, matching lines are merged to the first occurrence. The info pages are a little more explanatory: 7.3 'uniq': Uniquify files 'uniq' writes the unique lines in the given 'input', or standard input if nothing is given or for an INPUT name of'. Synopsis: uniq (OPTION)... [INPUT (OUTPUT]] By default, 'uniq' prints its input lines, except that it discards all but the first of adjacent repeated lines, so that no output lines are repeated. Optionally, it can instead discard lines that are not repeated, or all repeated lines. The input need not be sorted, but repeated input lines are detected only if they are adjacent. In your version of unig, the program can act as a filter (input from stdin, output to stdout) or you can pass the name of the file to be processed via the command line. The code can be written in 'C' or 'C++, but only system calls can be used to process the file. Example Given the file hello Goodbye Goodbye hello hello
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
