UMBC CMSC291C CSEE |

UNIX Shell Programming

This project is for you to build a menu system for a new user. However, it will also allow for some more advanced features, such as allowing the user to use wild cards. In all cases, you must provide error checking to make sure the user does not attempt something that will not work. (This would include such things as did the user enter a filename when one is required. You don't have to worry about whether or not the user entered a valid filename was entered, because the command will do that.)

Make sure that any time the output from any command exceeds one screen of information, you break it up so that none of it scrolls off the screen before the user can read it.

There are many ways to do this assignment. You will be graded on whether your version meets the requirements specified.

It is possible to do this project with just one file. HOWEVER, THAT IS NOT A GOOD IDEA! I recommend that you put help display, the main menu and the three sub-menus into a total of five script files. It makes this project so much easier!!! Remember that the submenu then becomes a new process and you must ensure that the new process knows if it is in expert or novice mode!

Remember that you must allow the user to enter in one or more filenames and they are allowed to use wild cards.

I. The UNIX help main menu

You menu system will be started with by typing in the name of the shell script: myhelp.

myhelp without arguments

If there are no arguments, the user will be presented with the following menu on a cleared screen:

 

 

 

UNIX HELP MAIN MENU

    1 -- File and Directory Management Commands    
    2 -- Text Processing Commands    
    3 -- System Status Commands    
    4 -- Exit    

Enter your choice:

       

myhelp with one argument

The user may enter one argument with the command (considered the expert mode). That argument will be either:

help
file
text
status

If it is argument is help, you are to clear the screen and display a short message telling the user how to use your help command. Otherwise, your script is to display the appropriate sub-menu. NOTE: The last item on each sub-menu is different based on whether help was started in the expert mode or not.

II. The File Management Commands Sub-menu

Novice Mode

 

 

FILE AND DIRECTORY MANAGEMENT COMMANDS

    1 -- Display the contents of a file    
    2 -- Remove a file    
    3 -- Copy a file    
    4 -- List a file    
    5 -- Size of a file    
    6 -- Quit -- Return to main Menu    

Enter your choice:

       

Expert Mode

 

 

FILE AND DIRECTORY MANAGEMENT COMMANDS

    1 -- Display the contents of a file    
    2 -- Remove a file    
    3 -- Copy a file    
    4 -- List a file    
    5 -- Size of a file    
    6 -- Exit Program;   

Enter your choice:

       

III. The Text Processing Commands Sub-menu

Novice Mode

 

 

TEXT PROCESSING COMMANDS

    1 -- Search a file for a pattern    
    2 -- Count lines, words, and characters in specified files    
    3 -- Display line differences between two files    
    4 -- Quit -- Return to Main Menu    

Enter your choice:

       

Expert Mode

 

 

TEXT PROCESSING COMMANDS

    1 -- Search a file for a pattern    
    2 -- Count lines, words, and characters in specified files    
    3 -- Display line differences between two files    
    4 -- Quit -- Exit Program    

Enter your choice:

       

IV. The System Status Commands Sub-menu

Novice Mode

 

 

SYSTEM STATUS COMMANDS

    1 -- Display the current date and time    
    2 -- Current disk usage    
    3 -- List current local and environmental    
    4 -- Display process status information    

    5 -- Quit -- Return to Main Menu    

Enter your choice:

       

Expert Mode

 

 

SYSTEM STATUS COMMANDS

    1 -- Display the current date and time    
    2 -- Current disk usage    
    3 -- List current local and environmental    
    4 -- Display process status information    

    5 -- Exit Program    

Enter your choice: