Occurance of an element in an Array

In this blog, sharing code to find the occurrence of an element in an Array. In other words, find how many times a elements comes in an array.Explaination of Shell Script:1. Here we use dictionary which has key and value pair. 2. keys are mapped to the element of Array here.3. Setting value of each Key(which is element) equal to 1.4. Increment the value of key if it comes again by 1. arr=(4 3 1 1) ## First Array of 4 elementslen_arr=${#arr[@]} ## Length of Array Arr.i=0declare -A dict ##…