Sample output when an error occurs.
In Bash, logging can be as simple as redirecting or appending output to a file.
Create a simple function in Bash.
Let’s consider a simple Bash script that needs some refactoring.