Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please help me do Q1 to Q5 Checkpoint 2.2: Shell Script to mark all assignments (Please subait and evaluate your answer in VPL) Let's upload

please help me do Q1 to Q5
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Checkpoint 2.2: Shell Script to mark all assignments (Please subait and evaluate your answer in VPL) Let's upload the module2 files to the Linux server and browse to Assignments/ Let's write a seript to mark all the assignments in a class! 1. Suppose that the submission of each student is organized in the directory Assignments/UID, where UID is the University number of the student. 2. In this example, we have three students with UID 2012111111,2012222222 and 2012333333. 3. The test cases input. xt and correct.txt are located in the Assignments directory. 4. The shell script mark sh is under the Assignments directory, to be updated by you. 5. Evaluate your answer on Moodle. Test case files and student submissions are included in the evaluation environment. You only need to submit your updated mark.sh. 6. When locating a file or directory in mark sh, use the relative path instead of the absolute path as the root path in the VPL environment is not the same as that in the academy server. Consider the unfinished shell script mark sh Question 1: - What should be the code in 2]? (Reminder, spacing is criticall) - Hints: First we need to get the names of the files and directories under our current directory, what is the command to do this? How we can execute shell command in shell script and store the result in the variable al. Students? Question 2: - However, the command in 21 also returns files under the Assignments direetory, such as the test case files input.art and comect, ixt, as well as the shell script mark sh. - We need an if statement, what should be the condition in 22 ? - Hints: How can we check if sstudent is a directory? Question 3: - After we have identified the student's directories and browse into them one by one using the command, we need to check if the student has submitted assign.cpp or not. - What is the condition to be filled in 28 ? Question 4: - If the student has submitted assign. pp, we then need to compile the assign.cpp, and report on sereen if it cannot be compiled. - We need to check if assign.cpp can be compiled or not. - What is the condition to be filled in 24? - Hints: if the compilation is successful, what file will be created after executing the line gt+ assign.cpp -o assign.o 2> error,txt? - If the student has submitted assign..pp, and assign.cpp can be compiled, we then need to check if the output file output ot is the same as the test case correct.txt or not. - The result 2 diff output. txt ../correct. txt2/ command will store some value in the variable Sresult if ouput. oxt is different from correct tat. - Therefore, if the length of the string \$result is NOT EQUAL to , then there is something output by the diff command, that means qssieg e retums wrong answer. - What is the condition to be filled in 25 ? Upload your mark sh to the Moodle page "Checkpoint 2.2: Shell Script to mark all assignments" under Module 2 and evaluate it. You can refer to "Quick VPL. Guide" on Moodle if you don't know how to use the evaluation system

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Guide To Client Server Databases

Authors: Joe Salemi

2nd Edition

1562763105, 978-1562763107

More Books

Students also viewed these Databases questions

Question

Describe privacy concerns in analytics.

Answered: 1 week ago

Question

socialist egalitarianism which resulted in wage levelling;

Answered: 1 week ago

Question

soyuznye (all-Union, controlling enterprises directly from Moscow);

Answered: 1 week ago