Step 1 (2 marks): Create a file called YourFirstName_LastName_music . This file will contain information about your CD collection. Include at least 10 records.

Each record in the file should have the following fields. Use the “;” (semicolon character as a delimiter):
1. Artist
2. CDName
3. PurchaseDate
4. Cost
Sample CD collection content (create your own):
Christina Aguilera;Bionic;March 15, 2021;99
Kenny Rogers;21 Greatest Hits;June 20, 2021;64
… eight more rows ...
Step 2 (5 marks): Create a Bash script file called YourFirstName__LastName_L4 with a menu that lets
you:
 (1 mark) View the contents of the music collection file
1. this option should display the entire collection
 (2 marks) View the cost of the entire collection
1. this option should calculate the total cost of the collection and display it. Do not
hard-code the cost of the collection, you must have code to calculate it
 (0.5 mark) Search for all CDs from a particular artist
1. this option allows to search the collection given the artist name. Make the search
case insensitive. If there is a CD for the given artist name, the CD info should be
displayed. If there is not such CD in the collection, then “Nothing is found for the
artist specified” message should be displayed.
 (0.5 mark) Search for all CDs purchased on a specific date
1. this option allows to search the collection given the date. Make the search case insensitive. If there is a CD for the given date, the CD info should be displayed. If
there is not such CD in the collection, then “Nothing is found for the date specified” message should be displayed.
 (1 mark) An option to Exit
1. this option should confirm whether the user really wants to exit the script and if
the confirmation is given then the script should be terminated. Otherwise, the
script should continue running.

Step 1: Create a file called YourFirstName_LastName_music

You can create a file with your CD collection data using any text editor, for example:

```
Christina Aguilera;Bionic;March 15, 2021;99
Kenny Rogers;21 Greatest Hits;June 20, 2021;64
Tina Turner;Private Dancer;January 10, 2021;60
ABBA;Gold;February 28, 2021;70
Queen;Greatest Hits;July 12, 2021;85
Michael Jackson;Thriller;September 10, 2021;120
Elton John;Rocket Man;August 5, 2021;80
Madonna;Like A Virgin;April 30, 2021;90
The Beatles;Abbey Road;May 15, 2021;110
David Bowie;Blackstar;December 3, 2021;100
```

Step 2: Create a Bash script file called YourFirstName_LastName_L4

```bash
#!/bin/bash

music_file="YourFirstName_LastName_music"

function view_collection() {
cat "$music_file"
}

function total_cost() {
awk -F';' '{ total += $4 } END { print total }' "$music_file"
}

function search_artist() {
read -p "Enter artist name: " artist
result=$(awk -F';' -v a="$artist" 'tolower($1) == tolower(a)' "$music_file")
if [ -n "$result" ]; then
echo "$result"
else
echo "Nothing is found for the artist specified."
fi
}

function search_date() {
read -p "Enter purchase date: " date
result=$(awk -F';' -v d="$date" 'tolower($3) == tolower(d)' "$music_file")
if [ -n "$result" ]; then
echo "$result"
else
echo "Nothing is found for the date specified."
fi
}

function exit_script() {
while true; do
read -p "Are you sure you want to exit? (y/n): " yn
case $yn in
[Yy]* ) exit;;
[Nn]* ) break;;
* ) echo "Please answer yes or no.";;
esac
done
}

while true; do
echo "Menu"
echo "1. View the contents of the music collection file"
echo "2. View the cost of the entire collection"
echo "3. Search for all CDs from a particular artist"
echo "4. Search for all CDs purchased on a specific date"
echo "5. Exit"
read -p "Choose an option: " option

case $option in
1 ) view_collection;;
2 ) total_cost;;
3 ) search_artist;;
4 ) search_date;;
5 ) exit_script;;
* ) echo "Invalid option.";;
esac
done
```

Save the script, set executable permissions with `chmod +x YourFirstName_LastName_L4`, and run it with `./YourFirstName_LastName_L4`.