This is a Unix question. \"Consider the file roster provided. Assume it is curre
ID: 3823361 • Letter: T
Question
This is a Unix question.
"Consider the file roster provided. Assume it is currently in your home directory.
The fields are: Student ID, Posting ID, First Name, Last Name, Units, Grade Basis, Program and Plan, Academic Level, ASURITE, and Residency.
1. First you move the file to your ~/IFT383/Exams directory, change your working directory to ~/IFT383/Exams, convert the file to UNIX, and then open it in vi for editing.
2. Next, you got rid of all the double quotes inside the file, save as roster1 and exit vi
3. You also explore using the tr command to get rid of the double quotes in the file roster and save it as roster2
4. Then you perform a byte-by-byte comparison of the two files (roster1 and roster2) to display the list of mismatches
5. Assuming mismatches are found, you convert one of the file to another so that the two files are identical.
6. When they are identical, rename roster1 as classroster
7. You use cat command to create a file called header whose contents are the field names written exactly as mentioned above.
8. Open both header and classroster files in vi, then copy the contents of header into classroster, as the first line.
9. Now you use appropriate filters to format the file classroster obtained from 8) so it looks like below (note the space characters before and after the colon). Save the formatted file as iclassroster
Last Name : First Name : Student ID : Program and Plan : Academic Level : ASURITE
10. You want to know how many students in the class are from IT program
11. You want to know how many senior students from IT program are in the class
12. In general, you want to know how many Freshman, Junior, Sophomore, Senior, Post-Bacc Undergraduate, etc. are in the class
13. Now sort the file iclassroster on the Student ID field
14. Finally, add a last field called Email that is made of ASURITE@asu.edu"
Explanation / Answer
echo "Enter name of the student"
read name
echo "enter roll number"
read num
echo "Enter the marks of the student"
read m1 m2 m3 m4 m5
echo "Name of the student is $name"
echo "number of the student is $num"
echo "marks obtained"
echo "m1 m2 m3 m4 m5"
echo $m1 $m2 $m3 $m4 $m5
per=`echo ($m1 + $m2 + $m3 + $m4 + $m5) /5|bc`
echo Percentage is $per
if test $per -ge 60
then
echo "Grade:first"
elif test $per -ge 50 -a $per -le 59
then
echo "grade:second"
elif test $per -ge 40 -a $per -le 49
then
echo "grade:third"
else
echo "fail"
fi
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.