Shell and Script on Linux
All required files are attached in the zip.
Part I: Oh no, not again
Consider the file rosterwhich can be found on BlackBoard and will be uploaded to your home directory.
The format is:
“student ID”,”Posting ID”,”First Name”,”Last Name”,”Units”,”Grading Scale”,”School – Major”,”Academic Level”,”ASURITE”,”Residency”
Provide the commands used to preform the following tasks:
Ignore the moving file to directory part.
1.Move the rosterfile to the ~/IFT250/Exams/Finaldirectory.
2.Change your working directory to ~/IFT250/Exams/Final.
3.Use vi to replace all commas with spaces and save the file as viRoster.
4.Do the same without vi and save the output as newRoster.
5.Compare the viRosterand newRosterfiles line by line and display the lines that are different.
6.Find all instances of the word “Technology” in the viRosterand save the output as uglyRoster.
7.Use vi to create a file named headthat contains the field names written above, insert the viRosterfile into the headfile, and save it as badRoster.
8.Format the viRosterfile using vi so that it matches the example below and save it as goodRoster.
Last Name:First Name:Student ID:School:Major:Residency:Academic Level:ASURITE
9.Display the number of students in the goodRosterfile that are in the IT program.
10.Display the number of students in the goodRosterfile that are both a senior and a resident.
Part II: Well this is AWKward
Consider the file classrosterwhich can be found on BlackBoard.
The format is:
“student ID”,”Posting ID”,”First Name”,”Last Name”,”Units”,”Grading Scale”,”School – Major”,”Academic Level”,”ASURITE”,”Residency”
Create an awk script named exam.awkthat will output a header of the field names shown below and each of the entries in the following format:
Last Name:First Name:Student ID:School – Major:Academic Level:ASURITE:Email
With the Emailfield of the following format:
ASURITE@asu.edu
In addition to this, your script will display the number of students in the IT program and in each of the academic levels
The script will run from the command prompt using the following command:
awk –f exam.awk classroster
Capture a screenshot of the output and include it in your submission.
part III: So Long and Thanks for the Perl
Create a perl script named exam.plthat meets the following criteria:
- Constant values to store the maximum value of each component.
- A function that will take an array of values and return the sum.
- A function that will take two values and return the percentage of the first in relation two the second.
- A function that will take a percentage grade and return the letter grade based on the following rubric:
- A hash of components that will be used to store grade values for calculation.
Component | Total Max |
Quiz | 10 |
Class Activities | 135 |
Homework | 150 |
Labs | 155 |
Discussion | 105 |
Exams | 180 |
Percentage | Letter Grade | Percentage | Letter Grade |
>= 95.0 <= 100.0 | A+ | >= 80.0 < 82.5 | B- |
>= 90.0 < 95.0 | A | >= 77.5 < 80.0 | C+ |
>= 87.5 < 90.0 | A- | >= 70.0 < 77.5 | C |
>= 85.0 < 87.5 | B+ | >= 60.0 < 70.0 | D |
>= 82.5 < 85.0 | B | < 60 | F |
Your script will prompt the user for the score of each component and store it in the respective hash value then return the final score and letter grade.
Capture a screenshot of the output and include it in your submission.
Submissions
Once you’ve completed all the activities, perform the following steps for
submission:
1.Make sure all of your answers are correct and complete.
Ignore step 2 because you will be working on your own system instead
2.Download your scripts exam.awkand exam.pl,as well as any processed files and any other files you feel necessary, from the ASU file host
https://webapp4.asu.edu/myfiles
- Submit the IFT250Finalfile, as well as the files listed above and any other files you feel necessary, to BlackBoard
"You need a similar assignment done from scratch? Our qualified writers will help you with a guaranteed AI-free & plagiarism-free A+ quality paper, Confidentiality, Timely delivery & Livechat/phone Support.
Discount Code: CIPD30
Click ORDER NOW..


