Question
using c++ unix Task 1 . (50 points) Implement your own version of a command to display a file that should be almost same as
using c++ unix
Task 1. (50 points)
Implement your own version of a command to display a file that should be almost same as the UNIX cat command that displays a requested file on the screen. Name your command as "show" that should have the following syntax:
show file_name
that displays the file called file_name and reports with an appropriate message if the file name does not exist or cant be opened.
You need to create a text file name "file1" for at least 30 continuous character for testing purposes. Also, you need to upload the snapshot of the demo of your program in console of Linux. Only zip the file to be .zip. That is in the folder Lab 3, you only need to have 5 files after compile: show.c body.c show body file1 snapshot(.jpg,.bmp....). (body is the one for task 2)
Task 2. (50 points)
Modify the above program to implement your own version of UNIX command called body like UNIX commands head or tail. Your command body should print from mth line to nth line from the given file. It should have the following syntax:
body m n file_name
The command reports with an appropriate message if the file name does not exist or cant be opened. If you don't know how to do the mth line to nth line to get the full scores, you can do the mth character to nth character instead, with 80% of the score.
You need to create a text file name "file1" for at least 10 lines for testing purposes. Also, you need to upload the snapshot of the demo of your program in console of Linux. Only zip the file to be .zip. That is in the folder Lab 3, you only need to have 5 files after compile: show.c body.c show body file1 snapshot(.jpg,.bmp....).
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started