Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C program mycat whose behavior resembles that of the system command cat. Unlike the standard cat, mycat will not work with the standard

Write a C program mycat whose behavior resembles that of the system command cat. Unlike the standard cat, mycat will not work with the standard input. mycat must accept the following parameters:

$ mycat [-bens] file1 [file2 ...]

mycat must receive at least one parameter, file1, whose content will be printed on the screen. If more than one file name is specified, the contents of all of the files will be printed.

mycat must accept any combination of the following switches:

-b Number the non-blank output lines, starting at 1.

-e Display a dollar sign ('$') at the end of each line.

-n Number the output lines, starting at 1.

-s Squeeze (remove) all empty lines, causing the output to be single spaced. An empty line can contain one or more whitespace characters (e.g. space, tab, newline, carriage return).

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_2

Step: 3

blur-text-image_3

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

Database Design For Mere Mortals

Authors: Michael J Hernandez

4th Edition

978-0136788041

More Books

Students also viewed these Databases questions

Question

How would you describe Mark Zuckerberg as a team leader?

Answered: 1 week ago