Please Help Asap UNIX

1) Requirements of the script:
a) You can use any shell, but you must identify the shell on the first line. Example: #!\bin\bash
b) Fully document the script. Explain what you are doing. Points will be deducted for undocumented
c) You will be provided 3 data files that you MUST copy to use for your project as noted below.
d) You MUST use a looping structure to process Data File 1 to find the Olympic Category Code to access
Data File 2.
e) A second looping structure will be nested inside the first to find all the events that correspond to
that Olympic Category Code.
f) You will then use grep to access Data File 3 based upon the information found inside Data File 2.
g) Your script MUST be called “”.
h) Your output file will be as shown below and all output redirection will happen inside the script.
i) Your output files MUST be called “project2.out”
The script should use "echo" or “printf” statements to display your name, title, and any information you need to
in the script.
Example output header required in every output file:
echo ”****************************************” > $outfile
echo “* CIS129 Project 2 Your Name *” >> $outfile
echo “* `date` *” >> $outfile
echo “****************************************” >> $outfile
echo >> $outfile
echo >> $outfile
The example output header information shown below is just an example. Feel free to make it your
own look and appearance.
2) The data files can be copied from: /opt/cis129/fulton/project2
NOTE: Copy the files in the above directory to your home directory to use for the
WARNING! You cannot use Filezilla to copy the files, that is an FTP program! You
must use the cp command you learned in Section 4!
Example: cp source location destination location
Remember, when you login to the cislinux server, you are in YOUR HOME DIRECTORY! So to copy the
files, you just have to specify where you want to copy (cp) the files from (source)
(/opt/cis129/fulton/project2/*) and put them where you are (destination) (in your Home directory,
which is your current directory specified by a . (period)).
Datafile 1: (Olympic Category) Datafile 2: (Events) Datafile 3: (Gold Medal)
Paddling 001 001 Kayak Kayak Germany
Swimming 002 001 Canoe Beam Russia
Fencing 003 002 Freestyle Freestyle United States
Volleyball 004 002 Breaststroke Foil France
Gymnastics 005 002 Backstroke Breaststroke Australia
002 Butterfly Sabre Qatar
003 Foil Beach Brazil
003 Sabre Vault China
004 Beach Canoe Uzbekistan
004 Indoor Indoor Canada
005 Vault Butterfly Hungary
005 Floor Bar Japan
005 Bar Backstroke Netherlands
005 Beam Floor Romania
3) Output file:
Student Header information as described above…
CIS 129 – Project 2
Student Name Date/Time
Olympic Sport Event Country of Gold Medal Winner
============ ===== =========================
Paddling Kayak Germany
Canoe Uzbekistan
Swimming Freestyle United States
Breaststroke France
Backstroke Australia
Butterfly Hungary
Fencing Foil France
Sabre Qatar
Volleyball Beach Brazil
Indoor Canada
Gymnastics Vault China
Floor Romania
Bar Japan
Beam Russia
4) When you have completed the project, you will upload 2 files into Moodle for
1) The script:
2) The output file: project2.out

I have a general idea for this code but I can't think of a way to match the variables from each datafile, please let me know the correct code I would need for this assignment so I can match it to my own.
Last edited on
#include <iostream>
#include <cctype>
#include <limits>

int main()
   std::cout << "Do you want someone to do all the work for you? ";
   char answer{};
   std::cin >> answer;

   std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');

   if (std::toupper(answer) == 'Y' ) { std::cout << "Post it in the Jobs section.\n"; }

   else { std::cout << "Show what you have coded so far.\n"; }

   std::cout << "Good luck.\n";
scp is more secure than cp.
you forgot to link your attempt or ask a specific, targeted question. I can't tell what exactly the question is, it mostly just has an assignment text.
jonnin wrote:
scp is more secure than cp.

The 'scp' is SSH's "copy file(s) over network" version. It uses SSH's authentication and encryption.

The 'cp' copies file(s) within one machine. You are already authenticated and you have serious problems if other users of the same machine can and will tap on your copy operations. Besides, they probably have read access to /opt/cis129/fulton/project2/ too.

I'm not sure by the instructions whether user has to copy the input and then run the script, or should the script do the copy as one step?
We can help, and respond pretty quickly too. But help doesn't mean doing it for you,

If you really want help, post what you've done, or describe what you're stuck on. Then we can comment on that,
Amazing tutorial! This is exactly the type of post we like to see on the tutorials board!
Topic archived. No new replies allowed.