A Simple Shell

Due 2/20, 11:59 p.m.

EMAIL: abdollah@ccsu.edu

 

Starting with the zip file. Unzip it first and design and implement a simple, interactive shell program that prompt the user for a command, parser the command (you do not need to write a parser!), and then execute it. The commands for the first project is:

 

  1. attrib file.

To make the file read only.

           

  1. copy fileA fileB

To copy fileA into fileB.

 

  1. delete file

To delete the file.

 

  1. dir name                      or just dir

The listing of the directory name is displayed. In case of just dir, the list of the      items in the current directory should show up.

 

  1. exec Name

The shell should execute the class Name.class. The java file Name.java is the main method (i.e. the method main is declared in this class).

 

  1. mkdir name

Makes a directory named name.

 

  1. date

Displays the current date.

 

  1. time

Displays the current time.

 

  1. edit

displays the Notepad editor on the screen.

 

  1. rename fileA fileB

Renames  fileA to fileB.

 

  1. rmdir name

Removes the directory named name.

 

Note that in most of these commands the user types a path and a name. For example if the user types:

dir C:\windows

The files and the directories of the directory windows must show up.