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 3 – The Falcon Shell

Posted on 2018-12-022018-12-02 By Presto Bear No Comments on CSC/CPE 3350 Lab 3 – The Falcon Shell

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

Problem:
1. (60 points) The Shell Program
Note: parameters in [] are optional, parameters in <> are required. The | (pipe) means “or.”
• Invoking falsh, usage, and errors (5 points)
o Usage: falsh [-h]
 The optional -h flag prints the help message (see below) and immediately exits.
o After invoking falsh, it runs until the user types the exit command.
o Errors should not end a falsh session. Instead, print an appropriate error message –
generally, this will be “command not found.”

• Handling whitespace (2 points)
o Note on whitespace: all commands typed into falsh should ignore leading and trailing
whitespace. For example, “ cd “ should work the same as “cd.” Tip: youmight want to start with an implementation that does not account for extra whitespace,
add it in last.

• Built-in Commands (18 points)
o Per the pseudocode above, falsh should handle built-in commands as special cases –
do not fork a child process, just handle these “directly” in the shell program.
o exit – exit the program
 Usage: exit
o pwd – print the current working directory. Tip: you should use the getcwd() function.
 Usage: pwd
o cd – change directory.
 Usage: cd [dir]
 If the optional dir is provided, change to the specified directory.
 If no arguments are provided, change to the user’s home directory. Tip: use
getenv(“HOME”) to retrieve the user’s home directory.
 Tip: you should use the chdir() function.
o setpath – sets the path, user must provide at least one argument (directory). The
path is where falsh will look for executable programs to run.
 Usage: setpath
 setpath overwrites the path with whatever arguments the user enters.
 The path when falsh launches should contain only /bin.
Example:
User launches falsh
Path contains only /bin
User invokes: setpath /bin /usr/bin
Path now contains /bin and /usr/bin
User invokes: setpath /usr/share/bin
Path now contains only /usr/share/bin
o help – list all built-in commands with short, user-friendly descriptions.
 Usage: help

• Redirection (15 points)
o Shells typically allow for redirection between programs. For example, in bash try the
following: echo blah > tmp_file_lab3.txt
In this example, nothing is printed to the screen and the text “blah” is instead directed
to the file tmp_file_lab3.txt. Note this file is truncated if it exists!
o You will implement simplified redirection in falsh: when the user invokes
command > filename, redirect command’s standard output to
.out and standard error to .err. A missing filename
argument or multiple arguments should not be allowed: print a useful error message
and do not run command.

• Other Commands (15 points)
o Any non-built-in command should be executed if it is in one of the directories specified
in the user’s path. Search the paths in the order entered by the user. Fork a childprocess, pass appropriate arguments to exec, and wait for the child to return before
continuing to accept user input.

Assignment Help!!!
Linux Kernel Module Tags:CSC/CPE 3350 Lab 3 – The Falcon Shell

Post navigation

Previous Post: CSC/CPE 3350 Lab 2
Next Post: Linux C PID Manager Program

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.