LINUX Bash Shell Script

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!

  1. The problem statement, all variables and given/known data:

Write a bash shell script that presents work information of employees of a department from a company data set. The bash script file should be called "extract" and should be invocable as

$ ./extract

from the command line. The company data set layout is presented in six data files with the following field descriptions.

The script should accept a project number (1/2/3/10/20/30) and output

  • the name of the project
  • the name of the manager of the controlling department of the project
  • the total number of employee work hours on that project
  • the total number of dependents of all employees who work on that project.

Also, the script should prompt the user and repeat the task for another project number if requested.

  1. Relevant commands, code, scripts, algorithms:

Here is a sample output for the script. You may need to use the following Linux commands: awk, cut, echo, for, grep, if, join, let, read, sort, tr, trap, wc, while . Make sure to sort the input files of join commands on the join fields.

asg4.out[+]
bash-3.00$ ./extract
Enter project number (1/2/3/10/20/30): 1
Project name: ProductX
Manager's name: Franklin T Wong
Total employee work hours: 52.5
Total number of dependents: 3
Would you like to process for another project? [y/n]: y
Enter project number (1/2/3/10/20/30): 2
Project name: ProductY
Manager's name: Franklin T Wong
Total employee work hours: 37.5
Total number of dependents: 6
Would you like to process for another project? [y/n]: y
Enter project number (1/2/3/10/20/30): 3
Project name: ProductZ
Manager's name: Franklin T Wong
Total employee work hours: 50.0
Total number of dependents: 3
Would you like to process for another project? [y/n]: y
Enter project number (1/2/3/10/20/30): 10
Project name: Computerization
Manager's name: Jennifer S Wallace
Total employee work hours: 55.0
Total number of dependents: 3
Would you like to process for another project? [y/n]: y
Enter project number (1/2/3/10/20/30): 20
Project name: Reorganization
Manager's name: James E Borg
Total employee work hours: 25.0
Total number of dependents: 4
Would you like to process for another project? [y/n]: y
Enter project number (1/2/3/10/20/30): 30
Project name: Newbenefits
Manager's name: Jennifer S Wallace
Total employee work hours: 55.0
Total number of dependents: 1
Would you like to process for another project? [y/n]: y
Enter project number (1/2/3/10/20/30): 15
No project exists with the given project number
Would you like to process for another project? [y/n]: n
bash-3.00$ exit
exit
Script done on Wed 10 Nov 2011

  1. The attempts at a solution (include all code and scripts):

  2. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
    Miami Dade College

Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).

Also, please post what you've tried.