Skip to content
  • Home
  • News
  • Sample Code
  • How To
  • Tutorial
  • Assignment Help!

Student Assignment Help

Assignment Solution @ Assignment Help on Fiverr.com

  • Home
  • News
  • Sample Code
    • C/C++ Sample Code
      • C in Linux
        • Linux Kernel Module
      • C in Windows
    • Java Sample Code
    • Python Sample Code
    • New Jersey Standard ML (SML/NJ)
    • Oracle Sample Code
    • Database Analysis and Design Sample
  • How To
    • HTML-XML-CSS
    • Java
    • MySQL
    • Oracle
    • Linux RedHat
  • Tutorial
    • System Analysis and Design
    • Data Flow Diagram DFD
    • Database Analysis and Design
    • C/C++ Language
    • WordPress
      • WordPress Basic
      • WordPress Security
  • Assignment Help!

CSC/CPE 3350 Lab 2

Posted on 2018-12-022018-12-02 By Presto Bear No Comments on CSC/CPE 3350 Lab 2

Download Solution: Click to Download Solution
Solution File Name: 1_A.zip
Unzip Password: prestobear.com

Problem:
In this lab, you will implement your own versions of some popular Linux programs. All programs must
be written in C. No C++ or other languages are allowed. All programs must be built and tested on
luke – your code must work on luke, I will not test it elsewhere.

You will be working individually for this lab. You may discuss high-level concepts with other students,
but you should never share solutions or show each other code.

There are three requirements for this assignment that contribute to your final grade: the programs
themselves, comments and style, and GitHub commits.
1. (60 points) The Programs
Note: parameters in [] are optional, parameters in <> are required. The | (pipe) means “or.”
new_cat (10 points)
-Usage: ./new_cat [file.txt]
-If the [file.txt] argument is passed, open the file and print it to stdout. If there is no
second argument, repeat what the user types on stdin back to stdout (until the user hits
CTRL+D to indicate EOF).
-Make sure to compare your output to cat. Note this is not exactly like cat: only one file
argument should be accepted, and we are not implementing the various command line flags.
-Make sure to fail gracefully if the file does not exist or if > 2 arguments are passed.

new_echo (10 points)
-Usage: ./new_echo [arg] [arg] … [arg]
-Print all [arg] arguments to stdout.
-If there are no [arg] arguments, simply print a newline and end the program.
-Make sure to compare your output to echo. Note this is not exactly like echo, since we are
not implementing the various command line flags.
-Make sure to fail gracefully as needed (no specific requirements).

new_tail (15 points)
-Usage: ./new_tail [-n N] [file.txt]
-If [file.txt] is specified, print the last N lines of that file (default is 5 lines if -n is not
used). Otherwise, read from stdin until the user hits CTRL+D, and print the last N lines typed
by the user.
-If the [-n N] flag is used, print the last N lines.
-The [file.txt] and [-n N] order should not matter – both orderings should be allowed.
-Make sure to compare your output to tail. Note this is not exactly like tail: only one file
argument should be accepted, and we are not implementing the various command line flags
(except for -n). In addition, tail by default prints the last 10 lines, new_tail prints 5.
-Make sure to fail gracefully if the file does not exist, if too many (or too few) arguments are
passed, or if the argument order is wrong (e.g., ./new_tail -n file.txt 10).

new_wc (20 points)
-Usage: ./new_wc [-l|c] [file.txt]
-If[file.txt] is specified, print a count of the number of words in file.txt.
-If no [file.txt] argument is specified, read from stdin until the user hits CTRL+D.
-If the -l (lowercase L) flag is specified, print the number of lines and the number of words.
-If the -c flag is specified, print the number of characters and the number of words.
-For simplicity, only let the user enter one of -l or -c (not both).
-The [file.txt] and [-l|c] flag order does not matter.
-Note this is not exactly like wc: only one file argument should be accepted, and we are not
implementing the various command line flags (except for -l and -c).
-Make sure to fail gracefully if the file does not exist, or if too many (or too few) arguments are
passed.

Assignment Help!!!
C in Linux Tags:CSC/CPE 3350 Lab 2

Post navigation

Previous Post: [SOLVED] Linux Segmentation Fault (Core Dumped)
Next Post: CSC/CPE 3350 Lab 3 – The Falcon Shell

Leave a Reply Cancel reply

You must be logged in to post a comment.

Assignment Help!!!

Key Posts

  • Chapter 5 – Crow’s Foot Notation
  • Sample Java Program for Triangle
  • [SOLVED] Could not find this item. This is no longer located
  • Chapter 4 – DFD Level Diagram Violation Rule
  • Using WireShark for IP Datagram, RIP 2, OSPF
Assignment Help!!!

Recent Posts

  • Windows 10: How to start Command Prompt as Admin and Terminate a process
  • Java How to Trust all Email Server
  • [Solved]: Windows 10 100% Disk Usage
  • Weddings, Parties, Everything Catering Services System
  • CSC/CPE 3350 Lab 4 Part 1 – Recursive File Search
  • Zayed University
  • Kitchen Gadgets
  • Food Ordering System
  • Investment bank XYZ Ltd
  • CSC/CPE 3350 Lab 3 – The Falcon Shell
  • CSC/CPE 3350 Lab 2
  • Analyzing Cost and Benefit: Campus Bikes
  • Emirates Top Auto Parts
  • Sports News
  • Workington Council
Assignment Help!!!

Copyright © 2022 Student Assignment Help.