Your task is create a bash shell script that reads in student
Ask Expert

Be Prepared For The Toughest Questions

Practice Problems

Your task is create a bash shell script that reads in student

Task 4

Topic: bash scripting and Markdown; handling files

Submission: You will create a bash script called userid_q4.sh where userid is your student number, and a (Github-flavoured) markdown file called reportTemplate.md. These two files must be in the Q4 directory of your repository; other files may be included.

You are a tutor in CSC3333 Software Engineering 3. Your task is create a bash shell script that reads in student marks for an assignment and creates a feedback PDF file that includes the marks, comments, student IDs and student name. Your script will read in a template .md document from which to create the output PDFs (by substituting placeholders with values).

• You are provided two comma-separated files; Students.txt which contains student IDs and student names and Marks.txt which has a student ID, marks for each of 3 questions and some comments.

• You do not need to error-check the contents of these files. For example, you can assume that the student IDs are present correctly in each file and the marks are correctly integers 0-10.

• All student numbers are assumed to start with a u.

Your tasks for this assignment:

1. Create a markdown document called reportTemplate.md. Your template .md document should look as similar as possible to the example reportTemplate.pdf provided. The document must be able to be transformed using pandoc to PDF without errors.

2. Write a bash script called userid_q4.sh where userid is your student ID. The script takes no arguments, and it must perform the following tasks:

• Verify that the input files Students.txt and Marks.txt exist and can be read by the script otherwise exit.

• Verify that Marks.txt is not empty, otherwise exit.

• Verify that reportTemplate.md exists, otherwise exit.

• Verify that the output directory OUTPUT exists, otherwise exit.

• For each student, the script must produce a .md document which replaces the placeholder information (marks for each question, total, comments, student ID and name) in the reportTemplate.md file. This file should be called studentid.md where studentid is the student’s id number.

• Transform the .md documents using pandoc and the resulting .pdf files should be placed in the OUTPUT directory.

• Clean up any intermediate files and remove the created studentid.md document.

• At each step, inform the user of what is happening. All other output and errors from other commands should be suppressed.

3. Your script should contain comments at the top (for users), and comments for each significant block of code (for developers).

Hint
ComputerA file is a computer object that houses data, details, preferences, or instructions utilized by a software. Application files, data files, and system files are the three different sorts of files found on computers....

Know the process

Students succeed in their courses by connecting and communicating with
an expert until they receive help on their questions

1
img

Submit Question

Post project within your desired price and deadline.

2
img

Tutor Is Assigned

A quality expert with the ability to solve your project will be assigned.

3
img

Receive Help

Check order history for updates. An email as a notification will be sent.

img
Unable to find what you’re looking for?

Consult our trusted tutors.

Developed by Versioning Solutions.