The whole point of automation is that it helps handle repetitive, tedious, and long-running tasks. For instance, the mailbox backup script that I spoke about in the previous recipe, Displaying an interactive menu, took a long time to back up large mailboxes. Sometimes, staring at a terminal that seems to do nothing is unnerving—not to mention not knowing whether the script is actually doing something or not.
This is where writing progress comes into the picture. Here is the task: count 25 seconds and write progress for the percentage of time elapsed.