LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Help on my Linux Homework ! bash shell script / input-output data etc (https://www.linuxquestions.org/questions/programming-9/help-on-my-linux-homework-bash-shell-script-input-output-data-etc-708841/)

Bebelindo 03-03-2009 11:26 AM

Help on my Linux Homework ! bash shell script / input-output data etc
 
Hi...if some could give me instructions on how to proceed with this assigment....my professor told me that we may use the following commands : awk ,cut,echo,for,grep,if,join,read,sed,sort,trap,while .

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 department number (1/4/5) and output

the name of the department
the name of the manager of the department
the number of projects controlled by the department
the total salary of all employees who work for that department.
Also, the script should prompt the user and repeat the task for another department number if requested.

pixellany 03-03-2009 11:32 AM

Per the LQ Rules, please do not post homework assignments verbatim. We're happy to assist if you have specific questions or have hit a stumbling point, however. Let us know what you've already tried and what references you have used (including class notes, books, and Google searches) and we'll do our best to help. Also, keep in mind that your instructor might also be an LQ member.

Above is our canned response for homework......
You DO get credit for acknowledging that this is homework, but you need to show what work you have done and ask specific questions. I have to assume that you have already studied all those commands or that the instructor has assigned you the taks of learning them. With that in mind, please tell us more about which commands you understand, and which you do not.

TB0ne 03-03-2009 12:51 PM

Quote:

Originally Posted by Bebelindo (Post 3463489)
Hi...if some could give me instructions on how to proceed with this assigment....my professor told me that we may use the following commands : awk ,cut,echo,for,grep,if,join,read,sed,sort,trap,while .

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 department number (1/4/5) and output

the name of the department
the name of the manager of the department
the number of projects controlled by the department
the total salary of all employees who work for that department.
Also, the script should prompt the user and repeat the task for another department number if requested.

I agree totally with pixellany....you get points for acknowledging this is homework. However, the point of homework is for YOU to learn.

If you post what you've already written, and state what problems you're having, you'll probably get lots of help.


All times are GMT -5. The time now is 01:21 AM.