views:

30

answers:

1

Hello all,

I have a CGI shell script that download a list of packages. And it prints some information about the process and then starts running it. When complete, it shows the result of the job.

It works perfectly, however, on the browser doesn't show any thing until after the process is complete. Is there some way that tell the browser to load the information it already has and hold tight?

for example :

#!/bin/bash
echo -e "Content-type: text/html\n\n"

wgetCom="wget --quiet"

echo "<html><body><pre>"    

    echo    "Downloding autoconf"
    $wgetCom http://people.redhat.com/eblake/autoconf/autoconf-2.68.tar.bz2

    echo    "Downloding automake"
    $wgetCom http://ftp.gnu.org/gnu/automake/automake-1.11.1.tar.bz2

    echo    "Downloding bash"
    $wgetCom http://ftp.gnu.org/gnu/bash/bash-4.1.tar.gz

    echo    "Downloding binutils"
    $wgetCom http://ftp.gnu.org/gnu/binutils/binutils-2.20.1.tar.bz2

    echo "Download is Done"


echo "</pre></body></html>"

what i need is to show the echo's while process the shell script.

Any help would be much appreciated.

A: 

What you're asking for is turning off output buffering. I'm not sure if bash does at all or how to disable it, but I do know that apache will not buffer if it is configured to compress the output. Add a .htaccess file with this content:

BrowserMatch Mozilla no-gzip

And see if it magically starts working. If not, back to the drawing board.

Sorpigal