Professional Documents
Culture Documents
Read and Count
Read and Count
/bin/bash
input_file="$1"
declare -A occurrence_map
bash
Copy code
chmod +x count_unique_last_part.sh
Then, you can run the script by passing the path to the text file as an argument:
bash
Copy code
./count_unique_last_part.sh input.txt
Replace input.txt with the path to your input text file. The script will read the
file, store lines in the lines_array, count the unique occurrences of the last part
of each line, and display the results on the console.