Page 2 of 7ScriptingLanguages:PortfolioTask2Due Date: Tuesday 4 May at 17:00 AWSTContentsOverview……………………………………………………………………………………………………………………………………………1GENERAL REQUIREMENTS…………………………………………………………………………………………………………….1IMPORTANT NOTES: …………………………………………………………………………………………………………………….2Task 1 (5 marks)………………………………………………………………………………………………………………………………3Requirements ……………………………………………………………………………………………………………………………..3Task 2 (5 marks)………………………………………………………………………………………………………………………………4Requirements ……………………………………………………………………………………………………………………………..4Task 3 (5 marks)………………………………………………………………………………………………………………………………5Requirements ……………………………………………………………………………………………………………………………..5Task 4 (5 marks)………………………………………………………………………………………………………………………………6Requirements ……………………………………………………………………………………………………………………………..6How to submit your portfolio to Blackboard…………………………………………………………………………………………..7Page 3 of 7OverviewIn this assignment you are required to write four (4) scripts that will demonstrate the extent to which youhave understood the shell scripting concepts and practices addressed in Modules 5 to 8 inclusive. Each taskis worth five (5) marks for a total assignment value of 20 marks. These portfolio tasks will help you buildcapacity for implementing the final main assessment.GENERAL REQUIREMENTS 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-standardbash 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 externalfiles, 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 codecomments.Page 4 of 7Task 1 (5 marks)Write a script that employs a c-style loop to calculate the sum of two assignment scores as they appearordinally in separate arrays. The arrays are as follows: First Array12 18 20 10 12 16 15 19 8 11Second Array22 29 30 20 18 24 25 26 29 30 For example, the first two assignment scores to be added would be 12 and 22.The output to the screen of the results should be as follows: Student_1Student_2Student_3Student_4Student_5Student_6Student_7Student_8Student_9Result: xxResult: xxResult: xxResult: xxResult: xxResult: xxResult: xxResult: xxResult: xxStudent_10 Result:xx …where xx represents the sum of the two corresponding assignment scores in each array.Requirements Call the script addarray.sh The numbers and their sequence in the array are not to be changed In your script name the first array ass1 and the second array ass2 Do not add any of the values in the array in their raw form; only variables may be used incalculations Make sure the output to terminal is neatly aligned in columnsTask 1 Rubric ITEM#ITEMVALUE1The script has been given the name specified, i.e. addarray.sh0.252Script runs when initiated at the command line0.253Arrays properly declared and populated with the right values and sequence1.04All results correctly calculated with algorithm(s) that use only variables rather than rawvalues2.05Output to terminal is neatly aligned in columns0.56Sufficient code structuring to make script’s elements and their relationship easy torecognise0.57Sufficient commenting to explain how the script’s operation at all stages0.5TOTAL/5 Page 5 of 7Task 2 (5 marks)Write a script that retrieves the following information about a file:a. Its size in kilobytesb. The number of words it containsc. The date/time it was last modifiedRequirements Call the script fscheck.sh All code involved in retrieving this information from a specified file is to be contained within afunction named getprop() Your script will prompt the user for a file name to check, which will then be handed to the getprop()function, i.e. getprop [file_name] The getprop() function’s output is to be a message to terminal that states “The file [file_name]contains [word_count] words and is [file_size]K in size and was last modified[last_modified_date]” The last modified date is to be formatted as dd-mm-yy hh-mm-ss, e.g. 16-07-2020 09:59:44 Position the getprop() function within the fscheck.sh file and not in a separate file When your tutor runs your script, a file containing standard textual content will be used (could beany file type – do not hard-code). The file the tutor uses will be located in the same directory as yourscript so there is no need to account for the file’s path.Task 2 Rubric ITEM#ITEMVALUE1The script has been given the name specified, i.e. fscheck.sh0.252Script runs when initiated at the command line0.253getprop() function created and positioned correctly within the fscheck.sh script0.254File name acquired from user with prompt and passed to getprop() function0.55Function generates required output message to user0.56File word count determined by getprop() function correct0.757File size determined by getprop() function correct0.758File last modified date determined by getprop() function correct0.759Sufficient code structuring to make script’s elements and their relationship easy torecognise0.510Sufficient commenting to explain how the script’s operation at all stages0.5TOTAL/5 Page 6 of 7Task 3 (5 marks)Write a script that uses grep, sed and awk in combination to extract specific information from a .html fileand echo it to the terminal as a formatted summary.Requirements Call the script genrep.sh The script will extract the required data from the file named attacks.html The output of the script is to display each attack type and the total number of such attacks that tookplace in a given three (3) month period (see image below): Use piping to keep the lines of code required to achieve the outcome to a minimum You will be graded on your use of grep, sed and awk to achieve the required outcome, so refrainfrom using other methods to achieve the result, e.g. using an IFS read within a for or while loop, forwhich no marks will be awarded To assist you in writing this script, an attacks.html file (in a .zip folder) has been supplied with samplevalues. Please note that your tutor will use a file with the same name and structure as theattacks.html file provided, but containing different data. Do not therefore hard-code any of thevalues within the attacks.html file provided. When your tutor marks your script, the attacks.html file used will be located in the same directory asyour script when marked. There is no need therefore to prompt for the location of attacks.html aspart of your script.Task 3 Rubric ITEM#ITEMVALUE1The script has been given the name specified, i.e. genrep.sh0.252Script runs when initiated at the command line0.253grep used as a key part of the solution0.754sed used as a key part of the solution0.755awk used as a key part of the solution0.756The output to terminal is formatted as show in image above0.257The values output to terminal are correct0.58Piping has been used to minimise lines-of-code required to achieve solution0.59Sufficient code structuring to make script’s elements and their relationship easy torecognise0.510Sufficient commenting to explain how the script’s operation at all stages0.5TOTAL/5 Page 7 of 7Task 4 (5 marks)Write a script that uses awk exclusively to check all user passwords in a text file to ensure they meet thefollowing password strength rules:a. Must be eight (8) or more characters in lengthb. Must contain at least one (1) numberc. Must contain at least one (1) uppercase letterRequirements Call the script checkpw.sh The script will check all passwords in a file named usrpwords.txt The output of the script is to display each password with a message that states whether or not itmeets password strength requirements (see image below): The first line of the usrpwords.txt file contains header information and must be skipped You will be graded on your use of awk to achieve the required outcome, so refrain from using anyother means by which to achieve the result for which no marks will be awarded To assist you in writing this script, a usrpwords.txt file has been supplied with sample values. Pleasenote that your tutor will use a file with the same name and structure as the usrpwords.txt fileprovided, but containing different data. Do not therefore hard-code any of the values within theusrpwords.txt file provided. When your tutor marks your script, the usrpwords.txt file used will be located in the same directoryas your script when marked. There is no need therefore to prompt for the location of usrpwords.txtas part of your script.Task 4 Rubric ITEM#ITEMVALUE1Only awk has been used to achieve the required result0.752Header line is usrpwords.txt has been skipped0.253All passwords in usrpwords.txt have been correctly identified as meeting/not meetingstrength requirements*3.04Sufficient code structuring to make script’s elements and their relationship easy torecognise0.55Sufficient commenting to explain how the script’s operation at all stages0.5TOTAL/5 * There will be 12 passwords in the usrpwords.txt file your tutor uses, each worth 0.25 marks where correctly identified asmeeting/not meeting strength requirementsPage 8 of 7How to submit your portfolio to BlackboardSubmit the four (4) shell script (bash) files you have created in a zipped folder with the following namingformat:[surname]_[student-ID]_CSP2101_PF2.zipEND OF ASSIGNMENT BRIEF
