APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

Progress Bars

© December 2005 Tony Lawrence

We all know that software progress bars have to be taken with a large helping of salt. It's not at all unusual for the bar to have no discernible relationship to reality, and this is particularly apt to be true for operating system installations and software startups. If any percentage indication is shown, it probably cannot be correlated to required time. The percentage is likely to hang in the same place for frustratingly long periods of time or suddenly jump large increments for no apparent reason. Part of this is because for complex tasks, it can be very difficult to estimate completion time, and part of it is surely just programmer laziness.

Your Mac OS X shell scripts can have progress bars. You might use Platypus for that (it's an application wrapper). The iHook tool is similar, but gives more control over progress bars (and everything else it knows about). AppleScript Studio also has the ability to draw and control a progress bar. There are plain AppleScript progress bars also. A very simple program that does nothing but a progress bar for scripts is ShellBar.

Of course you can just do the dot thing:

 for i in *.dat
 printf "."
 cp $i /somewhere

Mac OS X displays a "Starting MAC OS X" graphic with a lovely blue progress bar that crawls along quite convincingly. In fact, though, it's totally fake. A program called "WaitingForLoginWindow" draws that display, but it isn't really measuring anything - it's just a bar to keep you happy while OS X starts. Well, that's not entirely true. Actually, it's drawing a bar that is calculated to last approximately the same length of time it ran on the last startup. What happens is that the Login Window process kills off this bar display when it is ready to let you log in. The bar stores how long it ran in /var/db/loginwindow.boottime and then goes away. Next time it runs, it uses that stored value to decide how quickly to move the bar. Cute, isn't it?

Well, apparently there is reason and precedence for this deception. The Placebo Mini-Pattern explains why this is useful and generally a good idea.

See https://daringfireball.net/misc/2005/04/tiger_details#waitingforloginwindow also.

Got something to add? Send me email.

(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> Progress Bars

Inexpensive and informative Apple related e-books:

Take Control of IOS 11

Photos: A Take Control Crash Course

Take Control of Automating Your Mac

Take control of Apple TV, Second Edition

Take Control of iCloud

More Articles by © Tony Lawrence

Printer Friendly Version

Have you tried Searching this site?

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us

Printer Friendly Version

I wanted to learn how to swim, so Google showed me how to turn on the water at the sink and let me splash it around a bit. They then dragged me into a helicopter, flew way out into the ocean and dumped me out. (Tony Lawrence)

Linux posts

Troubleshooting posts

This post tagged:

Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode