Why debugging saves hours
📖 Scenario: You are writing a simple bash script to process a list of filenames. Sometimes, the script has errors that cause it to stop or behave unexpectedly. Debugging helps find and fix these errors quickly, saving hours of frustration.
🎯 Goal: Build a bash script step-by-step that reads a list of filenames, counts how many have a specific extension, and prints the count. You will add debugging steps to see how it helps find mistakes early.
📋 What You'll Learn
Create a list of filenames in a bash array
Add a variable for the file extension to count
Use a loop to count files with the given extension
Print the final count
Use debugging commands to check script behavior
💡 Why This Matters
🌍 Real World
Scripts like this help automate file management tasks, such as counting or processing files by type.
💼 Career
Debugging skills are essential for any scripting or automation job to quickly fix errors and improve script reliability.
Progress0 / 4 steps