Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The uniq shell utility imitation Using the system calls we have discussed so far, develop your own version of the uni shell utility. The man

image text in transcribed
The uniq shell utility imitation Using the system calls we have discussed so far, develop your own version of the uni shell utility. The man pages describe uniq as: NAME uniq. report or omit repeated lines SYNOPSIS (OPTION-LINPUT (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 unit: Uniquify files unid' writes the unique lines in the given inpul, 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 mig, 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 or 'C++, but only system calls can be used to process the file. Example Given the file hello Goodbye Goodbye hello hello the output would be Using hello Goodbye hello What to turn in Grading will be based on whether your code generally works, has proper error checking for each system call, and handles certain cases such as when a file has no new line characters Adding some options as described in the man pages is always encouraged and will be considered as extras. It's to your beneft that you state those extra considerations in writing or even provide some running examples in your submission. . Please email your submission as a zip file. . Last but not the least, please do not copy code, whether from classmates or known

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

9th Edition

B01JXPZ7AK, 9780805360479

More Books

Students also viewed these Databases questions

Question

Draw a schematic diagram of I.C. engines and name the parts.

Answered: 1 week ago

Question

Develop a program for effectively managing diversity. page 303

Answered: 1 week ago

Question

List the common methods used in selecting human resources. page 239

Answered: 1 week ago