Scripting Languages: Software Based Solution Assignment 3 Answer
Scripting Languages: Assignment 3 Software Based Solution
Task: Part 2, Demonstrating Your Script (10 marks)6
Unit Learning Outcomes aligned with this assessment
UO 2: Design software solutions to perform desired tasks.
UO 3: Develop and deploy scripted software solutions using industry standard scripting languages to meet functional requirements.
Course Learning Outcomes aligned with this assessment
CLO 2: Apply comprehensive knowledge of concepts, principles, and techniques in the cyber security discipline to both theoretical as well as practical situations.
CLO 3: Apply creative thinking to identify and solve cyber security challenges.
- Your script will be marked on a standard Linux installation using the bash shell.
- You must only use bash shell script as covered in lectures and workshops.
- Refrain from using non-core commands, tools and utilities in your bash shell scripts. Non-standard bash commands, tools and utilities will not be downloaded and installed by your tutor.
- Ensure each script you write is fully self-contained and is not configured to be dependent on external files, libraries or resources to run.
- Do not use the trap command in any of your scripts.
- Each script you submit must contain your full name and student number at the beginning as code comments.
- This is an individual assignment only and must not be completed in collaboration with other students
- You may not work with others, acquire code from others, or provide code to others
- Further, you may not post any of the assignment tasks below to a code-development community of any kind seeking solutions or advice
- Nor may you copy and paste or otherwise reproduce code provided by external sources and use it as part of your own solutions
- Where it is found that any of these restrictions have been ignored, academic misconduct proceedings may be initiated
- Please read the checklist below and watch the associated video BEFORE submitting your assignment
Task: Part 1, Writing the Script (30 marks)
Having completed your two main portfolio activities, you have now been tasked with creating a script to build on that knowledge. Your script will automatically retrieve information from the ECU website, specifically in the Media Gallery page pertaining to the School of Science’s Cyber security courses.
Your task is to write a script solution that displays the following functionality, reliability and quality elements
wing menu options, with the functionality to which option refers being facilitated by your script solution
- Download a specific thumbnail, i.e. 1566 (by the last 4 digits of the file name)
- Download images in a range (by the last 4 digits of the file name), as an example, starting range of 1558 and ending range of 1569
- Download a specified number of images, as an example, if the user enters the numeral 5, 5 random images in the specified range of DSC01533 to DSC02042 will be downloaded
- Download ALL thumbnails
- Clean up ALL files
- Exit Program
When the file or files are downloaded the output (assuming no errors) should report to screen the following;
Downloading [image number], with the file name [filename and extension], with a file size of [file size and metric]
As an example, if I selected to download DSC01566 the output would look like this;
Downloading DSC01566, with the file name DSC01566.jpg, with a file size of
45.34 KB….File Download Complete
For multiple files being downloaded, each file will be printed on its own line
Downloading DSC01533, with the file name DSC01533.jpg, with a file size of
44.32 KB….File Download Complete
Downloading DSC01536, with the file name DSC01536.jpg, with a file size of
48.39 KB….File Download Complete
Downloading DSC01543, with the file name DSC01543.jpg, with a file size of
48.28 KB….File Download Complete
When the user selects menu item 5) Clean up ALL files, all directories and files created by your script are to be deleted from the system, leaving nothing behind. This means that your tutor’s working directory will be returned to its original state in preparation for the next student to be marked. Please note: this function will be carefully perused before being executed, and if appears that it may delete anything other than the directory and files your script created, it will not be run and no marks for this section will be awarded.
- Each of the command line functions operates as specified
- User input errors are trapped and addressed so incorrect/invalid values are not accepted and processed by the script’s code
- The user is required to specify a directory into which all images are to be downloaded, and if that directory does not exist, it is to be created
- All files downloaded are to be successfully stored in the directory nominated by the user
- If a file to be downloaded is already present in the nominated directory, the user is to be given the choice to overwrite it or skip that file completely
- File download messages are to show the correct size metric matching the files size in KB
- Where multiple files are downloaded, the total size of all those files is also to be printed to the terminal in KB or MB when the download process is complete
- Once a download process has been completed, the user is to always be returned to the menu; with the script terminating only when the user chooses option 6) Exit Program.
- Display any errors to screen (such as invalid input; please try again, file not available or incorrect file names or file already exists; do you wish to overwrite or skip)
- Display relevant, helpful and accurate prompts and messages to the user as required
- Implementation of professional code commenting
- Implementation of professional code formatting for readability
- Use of meaningful naming conventions (files, variables) Your assignment zip file should contain the following:
- The single bash script named getimages.sh
- Your work should be fully commented and your name and student number displayed at the top of your bash script
Task: Part 2, Demonstrating Your Script (10 marks)
The second part of your assignment is to record a student video through Panopto that demonstrates the following criteria
- You running your code through all four user options (single file, all files, file range and specified number of files, file clean up and exit) to demonstrate the functionality of your script
- You opening and briefly explaining each of your bash code files, with a focus on how each of the six
(6) functions work and why you selected a given coding approach
- Change one element of code, such as the message that is displayed when each file is successfully downloaded and then re-run the code to show the change in action
- Briefly outline any functions you did not get working, what issues you had and which bits of code you prioritised
- Should be clear, concise and of a quality that makes your voice clear and the code elements readable on screen
Your video must not be more than 8 minutes long (the video will be stopped at 8 minutes during the marking process). If you have a webcam in a laptop then a picture in picture setup (with your face in a corner of the video) is preferred. Industry uses video a lot for presenting and interviewing, so again, be clear, concise and stay focussed
Recording and submitting your video
To create a Panopto Student Video at the point of submitting your assignment, go to this video about using Panopto as part of your assignment submission
For the link above, jump to time index 1:32 and watch through to 2:25. Two important things to note below;
NOTE 1: when clicking the Panopto options in Blackboard when you are ready to record your video, please ensure your follow Step 3 exactly. If your video ends up in the normal Panopto Video folder we cannot see it, which will delay or prevent marking.
NOTE 2: once your video is recorded and ready in Blackboard for submission, make sure to also attach your zipped Bash file using the Browse My Computer button, then hit Submit.
So, this assignment is the final applied element of your tutorials and assessments to date and asks you to both write some code and then explain it the intended user. An assignment like this, if done to a suitable level of quality could readily be used as part of an application to undertake a Work Integrated Learning placement or even as part of a job interview, so try and think of the audience as not just the academic staff who will be marking your work.