LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-03-2009, 11:26 AM   #1
Bebelindo
LQ Newbie
 
Registered: Mar 2009
Posts: 3

Rep: Reputation: 0
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.
 
Old 03-03-2009, 11:32 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
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.
 
Old 03-03-2009, 12:51 PM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by Bebelindo View Post
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell script pipe input - bash mostly laikos Programming 4 11-09-2008 05:14 PM
bash: INPUT/OUTPUT error when remoting in saanjac Linux - Newbie 2 08-08-2008 03:38 PM
bash input/output redirect problem greno Programming 2 12-31-2006 03:23 PM
bash:output file names from shell script to vi sickboy Linux - Newbie 6 10-14-2004 03:40 AM
How do I zip and attach the output data of a grep | awk | mail shell script? 360 Programming 1 05-08-2002 08:26 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration