Introduction
Debugging with PS4 helps you see each command your script runs. It makes finding mistakes easier.
You want to find out why your script is not working as expected.
You need to see the order of commands running in your script.
You want to check the values of variables as the script runs.
You are learning how a bash script works step-by-step.