Project 2a: Shell (Linux) Solved

$24.99 $18.99

Questions? Send questions using piazza or use office hours. If the question is about your code, copy all of of your code into your handin directory (details below) and include your login in your email (you are free to modify the contents of your handin directory prior to the due date). Do not put code snippets into…

5/5 – (2 votes)

You’ll get a: zip file solution

 

Categorys:

Description

5/5 – (2 votes)

Questions?

Send questions using piazza or use office hours. If the question is about your code, copy all of of your code into your handin directory (details below) and include your login in your email (you are free to modify the contents of your handin directory prior to the due date). Do not put code snippets into piazza (unless they are very short). Also include all other relevant information, such as cutting and pasting what you typed and the results from the screen. In general, the more information you give, the more we can help.

Overview

The basic project description is found here. Please read this carefully in order to understand exactly what to do.

This project is to be done on the lab machines (listed here ), so you can learn more about programming in C on a typical UNIX-based platform (Linux).

Differences

There are some modifications to that basic description above. They are:

  • There is no need to do parallel commands. However, you can if you like; it’s not too bad, really.

  • There is a special built-in command you need to add, which is called loop. When the user types:

prompt> loop 10 somecommand

the wish shell should run somecommand ten times.For example, if the user types echo
hello
 as the command (to run the program /bin/echo , which just prints out whatever the arguments to it are), the shell should do this:

prompt> loop 5 echo hello
hello
hello
hello
hello
hello
prompt>

To make this slightly more useful, there is one more feature you’ll need to add, a loop variable. This variable is referred to by $loop . Thus, the user should then be able to do type:

prompt> loop 5 echo hello $loop
hello 1
hello 2
hello 3
hello 4
hello 5
prompt>

Notes

Before beginning: If you don’t remember much about the Unix/C environment, read this tutorial. It has some useful tips for programming.

This project should be done alone. Copying code (from others) is considered cheating. Read this for more info on what is OK and what is not. Please help us all have a good semester by not doing this.

Contest

There will be a contest for the smallest shell store. It will be announced soon (and the due date for the contest will be later than the turned-in version for credit). Whoever writes the code that is the the smallest shell will win fame, glory, and an amazing 537 prize! But mostly glory.

Handing It In

You should turn in one file, wish.c , which we will compile and test.

The handin directory is ~cs537-1/handin/login/p2a where login is your login. For example, Remzi’s login is remzi , and thus he would copy his beautiful code into ~cs537-1/handin/remzi/p2a . Copying of these files is accomplished with the cp program, as follows:

prompt> cp wish.c ~cs537-1/handin/remzi/p2a/

When done, type ls
~cs537-1/handin/remzi/p2a
 to see that all the files are in place correctly.

Finally, in your p2a directory, please include a README file. In there, describe what you did a little bit. There is no particular requirement for the length of the README; just get in the habit of writing a little bit about what you did, so that another human could understand it.

Project 2a: Shell (Linux) Solved
$24.99 $18.99