in reply to Capture wget progress bar

Not sure what you mean with progress bar. When doing

#!/usr/bin/perl $| = 1; open OUT, ">out.txt"; open WGET, "wget http://www.perlmonks.com 2>&1 |" or die "$!\n"; print OUT "$_" while (<WGET>); close WGET; close OUT;

I am getting the same in out.txt as I would via the command line:

$ cat out.txt --12:39:46-- http://www.perlmonks.com/ => `index.html' Verbindungsaufbau zu www.perlmonks.com:80... verbunden! HTTP Anforderung gesendet, auf Antwort wird gewartet... 200 OK Länge: nicht spezifiziert [text/html] 0K .......... .......... .......... .......... .......... @ 480.77 + KB/s 50K .......... .......... ... @ 11.39 + MB/s 12:39:48 (691.69 KB/s) - »index.html« gespeichert [75079]

Replies are listed 'Best First'.
Re^2: Capture wget progress bar
by Aristotle (Chancellor) on Mar 15, 2003 at 12:24 UTC
    You appear to have an old version of wget. From the manpage of 1.8.1:
    --progress=type

    Select the type of the progress indicator you wish to use. Legal indicators are dot and bar.

    ...

    Specifying --progress=bar will draw a nice ASCII progress bar graphics (a.k.a ``thermometer'' display) to indicate retrieval. If the output is not a TTY, this option will be ignored, and Wget will revert to the dot indicator. If you want to force the bar indicator, use --progress=bar:force.

    Here's what I get:
    $ wget --progress=bar:force www.perlmonks.org 2>&1 | less --13:18:17-- http://www.perlmonks.org/ => `index.html' Resolving www.perlmonks.org... done. Connecting to www.perlmonks.org[66.39.54.27]:80... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/html] ^M [<=> ] 0 --.--K/s + ^M [ <=> ] 12,889 + 42.81K/s ^M [ <=> ] 6 +3,569 125.67K/s ^M [ <=> + ] 75,054 148.07K/s 13:18:19 (148.07 KB/s) - `index.html' saved [75054]

    Makeshifts last the longest.