Program for create a menu, Programming Languages

The creation of the menu will involve writing procedural code, using decision logic, writing a loop, and using the case statement.  Although it is not required for grading, it is recommended that you flowchart and /or pseudo code your solution before coding.

General requirements

1. The script should contain a comment header as we discussed in class.  Include comments / pseudo code in your script.

2. Include the 'shebang' line for the bash shell found on Ubuntu.

3. Redirect any errors to a separate error file.

4. Clear the screen, change directories to the directory and present the current directory to the screen.

5. Make your file read, write, executable for the owner (that's you), read and executable for group and no permissions for other. -rwxr-x---

6. Create all report files with read only permissions for owner and group and no permissions for other.

7. At top of the menu check for the existence of the subdirectory logs.  If it does not exist, create it. 

8. Store the program directory in a variable and use it to define the full file name.

9. For each report write the files to the new logs directory, add the time to make it unique for each instance, i.e. whoyymmddhhmm.rpt

10. After writing the report to the disk, display all of the reports to the screen.  Look into using the awk program to 'pretty up' the report.  See the examples in the exercises.

11. Create a separate error file for each of the menu selections, adding the date and time like the report file, i.e. whoyymmddhhmm.err

The menu

1. Create a menu with the following selections (Hint start out by just creating the menu and echoing a message on the screen when a selection is made:

a. Who is on system report

b. Process Report

c. Web server report

d. Disk Space Report

e. Backup reports

f. Quit

2. Who is on System Report  --Create a new empty file to contain the first report.

a. Put the current date and time at the top of the file in this format: MM/DD/YY HH:DD (hint not default output - use formatting.)

b. List the users on the system and redirect the output from standard output to the file retaining the date and time you put in the file in task above.

c. Count the number of users on the system and add it to the end of the file.

d. Using one of the paginators, view the file you just created

3. User Process Report -- Create a second new file to contain report 2

a. Put the current date and time at the top of the file in this format: MM/DD/YY HH:DD (hint not default output - use formatting.)

b. List all of the processes associated with a tty into the file.

c. Sort the file by the process id.

d. Count the number of processes and put to the bottom of the file.

e. Using one of the paginators, view the file you just created

4. Web Server Report -- check for the program httpd.  Print a message on the screen with the status.  No files needed here.

5. Backup Reports -- Use the tar command and create a backup.  The backup should have the following functionality:

a. In the new logs directory, check to see if a sub-directory of archive exists, if it does not create it. 

b. Archive the files into a compressed tar ball in the logs/archive folder. 

c. Check if the file to check if it was created and has size greater than zero.

d. Check the file counts in the tar ball valid (hint use a file size check and/or compare the file count from the tar tv command with the count of files from the ls command)

e. If the backup passed the validation, remove the report and error files.

Posted Date: 2/28/2013 2:13:38 AM | Location : United States

Related Discussions:- Program for create a menu, Assignment Help, Ask Question on Program for create a menu, Get Answer, Expert's Help, Program for create a menu Discussions

Write discussion on Program for create a menu
Your posts are moderated
Related Questions
Problem 1 Explain the Booch Methodology 2 Why does every interaction diagram need a written description? Explain 3 Explain the five core workflows of the Unified Process

Define the The if statement - Computer Programming? The if statement is an influential selection statement and is used to control the flow of execution of statements. One of th

Write a Perl script that prints the contents of a file Write a Perl script that prints the contents of a file, prefixing each line with a line number. The script should acc

1. Write the dual of the above max-?ow problem. 2. Solve both problems with AMPL, and for each print the values of the vari- ables and the values of the dual variables (if a p

We want a program, a logic, we can list the intermediate films sandwiched between the 2 tapes (from - to) that indicates the user. example: From to

Write a python script that will take two file names as input (src, dest). Open src reading each line in the file, and replacing any occurrences of name with the string "redacted".

I need an efficient and fast reverse engineer with good knowledge of assembly x86 language, strong reverse engineering skills, IDA Pro (Hex-Rays) to Linux game routine, C, C++ prog

Often, DNA sequences are represented as a sequence of characters (String) and each character in the sequence corresponds with one of four nucleotides. A = adenine, C = cytosine,

Pseudo code the shows logic for a program that generates a random number, then ask the user to think of a number between 1 and 10

This assignment is an individual programming assignment using Perl. It addresses objectives 3, 4, 5 and 8 as listed in the Subject Outline document. The assignment is based on them