Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1. 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
  2.  
  3. $ ./extract
  4.  
  5. from the command line. The company data set layout is presented in six data files with the following field descriptions.
  6.  
  7. The script should accept a project number (1/2/3/10/20/30) and output
  8.  
  9. * the name of the project
  10. * the name of the manager of the controlling department of the project
  11. * the total number of employee work hours on that project
  12. * the total number of dependents of all employees who work on that project.
  13.  
  14. Also, the script should prompt the user and repeat the task for another project number if requested.
  15.  
  16. 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.
  17.  
  18.  
  19. asg4.out[+]
  20. Script started on Wed 10 Nov 2010 6:07:42 AM EST
  21. bash-3.00$ ./extract
  22. Enter project number (1/2/3/10/20/30): 1
  23. Project name: ProductX
  24. Manager's name: Franklin T Wong
  25. Total employee work hours: 52.5
  26. Total number of dependents: 3
  27. Would you like to process for another project? [y/n]: y
  28. Enter project number (1/2/3/10/20/30): 2
  29. Project name: ProductY
  30. Manager's name: Franklin T Wong
  31. Total employee work hours: 37.5
  32. Total number of dependents: 6
  33. Would you like to process for another project? [y/n]: y
  34. Enter project number (1/2/3/10/20/30): 3
  35. Project name: ProductZ
  36. Manager's name: Franklin T Wong
  37. Total employee work hours: 50.0
  38. Total number of dependents: 3
  39. Would you like to process for another project? [y/n]: y
  40. Enter project number (1/2/3/10/20/30): 10
  41. Project name: Computerization
  42. Manager's name: Jennifer S Wallace
  43. Total employee work hours: 55.0
  44. Total number of dependents: 3
  45. Would you like to process for another project? [y/n]: y
  46. Enter project number (1/2/3/10/20/30): 20
  47. Project name: Reorganization
  48. Manager's name: James E Borg
  49. Total employee work hours: 25.0
  50. Total number of dependents: 4
  51. Would you like to process for another project? [y/n]: y
  52. Enter project number (1/2/3/10/20/30): 30
  53. Project name: Newbenefits
  54. Manager's name: Jennifer S Wallace
  55. Total employee work hours: 55.0
  56. Total number of dependents: 1
  57. Would you like to process for another project? [y/n]: y
  58. Enter project number (1/2/3/10/20/30): 15
  59. No project exists with the given project number
  60. Would you like to process for another project? [y/n]: n
  61. bash-3.00$ exit
  62. exit
  63. Script done on Wed 10 Nov 2010 6:09:49 AM EST
  64. Page 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement