CSG6206 Advanced Scripting
{`Edith Cowan University School of Science Unit Title Advanced Scripting Languages Title Workshop 3 `}
Learning Objectives
- Analyse and evaluate scripted software in order to ensure reliability and security of developed solutions.
- Create and deploy scripted software that utilises pre-existing software as part of its core functionality.
Task
Download the following image dataset, and extract it to a folder of your choice.
http://sipi.usc.edu/database/misc.zip
Create a bash script to accept a single argument, which is the path of the image folder where you extracted the images from the dataset above. Before you proceed with the script, you must check if the argument was passed to the script. If the user did not pass any argument, then display an error message and end the shell script with exit code 1. If an argument was passed, and it is a valid path, then proceed, otherwise end the shell script with exit code 2.
If the path is a valid path, then store the following fields for the image files in an SQLite database using insert command:
- Image file name
- Image file size in KB (you can round off to the nearest integer, and assume 1KB = 1000B)
After storing the above information in the database, use the select command to display all the records. Make sure the records are sorted according to the file size.
Marking Criteria
The marking criteria for this workshop is as per Portfolio 1 Making Criteria. Please refer to the Portfolio 1 Assessment document in Blackboard.
Referencing
Your work must comply with ECU referencing guidelines. You are expected to provide referencing in your code where required. Insert as comments where appropriate.
Academic Misconduct
Please ensure that you have read and understood the information on plagiarism provided on Blackboard. Also note that all assignments submitted are subjected to automated and manual plagiarism checks before marking of your assignment commences. Students who are found to have evidence of plagiarism, direct copying or collusion will be dealt with as per the University – Academic Misconduct Policy.
Edith Cowan University School of Science Unit Title Advanced Scripting Languages Title Workshop 2
Task
This task builds on top of previous week’s workshop. So as a pre-requisite you are required to have the misc.zip downloaded from the source website.
http://sipi.usc.edu/database/misc.zip
Use an inbuilt command to determine different colour models (e.g. colour, grayscale as shown in Figure1). Count the distinct colour models through a loop, and create a report (report format shown below). You should incorporate at least one function in your script, and string processing to ensure report output looks similar to Table 1. The table border lines are not required, but the columns and rows should be formatted to look like a table structure.
Figure 1: Different Colour models (source: USC SIPI website, http://sipi.usc.edu/database/database.php?volume=misc)
Output Should be like that, using all unit resources
Table 1: Sample output to be produced
Grayscale |
Colour |
4.1.01 4.1.02 4.1.03 4.1.04 4.1.05 4.1.06 |
5.1.09 5.1.10 5.1.11 |
Marking Criteria
The marking criteria for this workshop is as per Portfolio 1 Making Criteria. Please refer to the Portfolio 1 Assessment document in Blackboard.
Referencing
Your work must comply with ECU referencing guidelines. You are expected to provide referencing in your code where required. Insert as comments where appropriate.
Academic Misconduct
Please ensure that you have read and understood the information on plagiarism provided on Blackboard. Also note that all assignments submitted are subjected to automated and manual plagiarism checks before marking of your assignment commences. Students who are found to have evidence of plagiarism, direct copying or collusion will be dealt with as per the University – Academic Misconduct Policy.