How do I echo a period every 2 seconds while 'yum -y update' is running?
I am writing a script to do some default configuration of customers' servers, and have it nearly working 100%.

What I cannot figure out is how to run `yum -y update` in some kind of a loop that echoes a "." every two seconds while it is updating.

Here is a code example to help explain a little more

    YUMLOG=/var/log/config.log
    while [ yum -y update > $YUMLOG 2>&1 ]
    do
        echo "."
        sleep 2
    done

Obviously, that doesn't work, but I don't know what changes to make so that it *does* work. I have other parts in the code that give me this 'progress bar' effect, but nothing inside of a loop. For example:

    if [ $SETXENNET != "y" ]; then
            sleep 1
            cp $TEMPLATEDIR/rc.local.template $TEMPLATEDIR/rc.local.new
            echo "."
            sleep 1
            cp $TEMPLATEDIR/rc.local.new /etc/rc.local
            echo "."
            sleep 1
            chmod a+x /etc/rc.local
            echo "."
            sleep 1
        else
            sleep 1
            cp $TEMPLATEDIR/rc.local.xen.template $TEMPLATEDIR/rc.local.xen.new
            echo "."
            sleep 1
            cp $TEMPLATEDIR/rc.local.xen.new /etc/rc.local
            echo "."
            sleep 1
            chmod a+x /etc/rc.local
            echo "."
            sleep 1
        fi

And, before I get people yelling at me for all the 'sleeps', I had to have a way to show progress of the script because the people running it will not have any idea what they are doing (they just read keystrokes from a checklist and check off when something has been done). 

So, I needed a nice, clean, easy way for them to 1) see what is happening in plain English (i.e. 'done', or 'skipped') and 2) visualize that the script is still running, even if nothing is displayed on screen.

Last, I cannot make a global change to the way I am showing progress, there is too much code to have to make changes to everything it does. But, if that is the absolute only answer, I guess that may be what I have to do...some day...


How do I echo a period every 2 seconds while 'yum -y update' is running?
===

I am writing a script to do some default configuration of customers' servers, and have it nearly working 100%.

What I cannot figure out is how to run `yum -y update` in some kind of a loop that echoes a "." every two seconds while it is updating.

Here is a code example to help explain a little more

    YUMLOG=/var/log/config.log
    while [ yum -y update > $YUMLOG 2>&1 ]
    do
        echo "."
        sleep 2
    done

Obviously, that doesn't work, but I don't know what changes to make so that it *does* work. I have other parts in the code that give me this 'progress bar' effect, but nothing inside of a loop. For example:

    if [ $SETXENNET != "y" ]; then
            sleep 1
            cp $TEMPLATEDIR/rc.local.template $TEMPLATEDIR/rc.local.new
            echo "."
            sleep 1
            cp $TEMPLATEDIR/rc.local.new /etc/rc.local
            echo "."
            sleep 1
            chmod a+x /etc/rc.local
            echo "."
            sleep 1
        else
            sleep 1
            cp $TEMPLATEDIR/rc.local.xen.template $TEMPLATEDIR/rc.local.xen.new
            echo "."
            sleep 1
            cp $TEMPLATEDIR/rc.local.xen.new /etc/rc.local
            echo "."
            sleep 1
            chmod a+x /etc/rc.local
            echo "."
            sleep 1
        fi

And, before I get people yelling at me for all the 'sleeps', I had to have a way to show progress of the script because the people running it will not have any idea what they are doing (they just read keystrokes from a checklist and check off when something has been done). 

So, I needed a nice, clean, easy way for them to 1) see what is happening in plain English (i.e. 'done', or 'skipped') and 2) visualize that the script is still running, even if nothing is displayed on screen.

Last, I cannot make a global change to the way I am showing progress, there is too much code to have to make changes to everything it does. But, if that is the absolute only answer, I guess that may be what I have to do...some day...

