Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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.
- 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[+]
- Script started on Wed 10 Nov 2010 6:07:42 AM EST
- 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 2010 6:09:49 AM EST
- Page 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement