Progress indicators
📖 Scenario: You are writing a bash script to simulate a task that takes some time. You want to show a progress indicator to the user so they know the script is working.
🎯 Goal: Create a bash script that shows a simple progress indicator using dots printed one by one with a delay.
📋 What You'll Learn
Create a variable to hold the total number of steps.
Create a loop that runs from 1 to the total number of steps.
Print a dot
. for each step without a newline.Add a short delay between printing each dot.
Print a newline after the loop finishes.
💡 Why This Matters
🌍 Real World
Progress indicators help users know that a script or program is running and not frozen. This is common in installers, data processing scripts, or any long task.
💼 Career
Many automation and scripting jobs require showing progress or status updates to users or logs. Knowing how to create simple progress indicators is a useful skill.
Progress0 / 4 steps