Q:

echo "." until command finishes executing

I am currently trying to figure out how to make bash draw a series of dots across the screen (kind of like a progress indicator) until a command finishes executing. For example, say I want to draw dots for a wget download:
wget -s http://url.tar.gz
until "above command has finished executing"; do
    echo -n "."
    sleep 0.05s
done

Can I use "$!" or "$?" to help solve this?
Thank you for the help!

A:

This will print dots until wget completes:
while sleep 0.1; do printf "."; done &
wget -q http://url.tar.gz
kill $!
echo "Finished"

wget has its own progress indicator.  The above uses -q to turn that off.
$! expands to the PID of the last process executed in the background which, in this case, is the while loop that prints the dots.  Thus, kill $! stops the loop, ending the printing of dots.

