On Thu, Jul 06, 2000 at 04:41:09PM +0200, Pixel wrote:
> "Alexander Skwar" <[EMAIL PROTECTED]> writes:
> 
> > Where's the difference (haven't yet looked at it)?  Did you simply change 
> > the wget definition to
> > 
> > $WGET="LC_ALL=C LANGUAGE=C wget --passive-ftp"
> 
> yep, in fact LANGUAGE=C is enough for wget...

Okay, I haven't tried it, but I actually don't like changing the language of
a program, so I created a small reg exp that extracts the byte number
printed by wget.

Assuming that line with filesize is something like

L�nge: 123,456 (unma�geblich)

or

L�nge: 654,321 [application/x-rpm]

or

Length: 987.654.321 (whatever)

this statement will return the byte size, if the line is stored in $line:

echo $line | perl -pe 'use locale;s?^\w+:\s([\d,.]+)\s[[(][\w/-]+[])]$?$+?'

This thingy works if the line begins with a number of word characters (like
a,b,c,�,�,�,� ...) followed by a colon (:) followed by a white space
character, followed by any number of digit characters or comma (,) or dot
(.) followed again by a whitespace which is followed by either ( or [ which
must be followed by a number of word chars or / or - and must be ended by
either ] or ).  It will then return the last matching braced term, which is
the number of bytes.

Don't know how you'd integrate that in grpmi.pm, but I bet that there's a
way :]  Oh, and if you don't use "use locale", \w would not match "special"
characters like �,�,�,�.

Although WGET="LANGUAGE=C wget" also works (tried it now), I still like my
solution more :]

Alexander Skwar
-- 
Homepage:       http://www.digitalprojects.com
Sichere Mail?   Mail an [EMAIL PROTECTED] fuer GnuPG Keys
ICQ:            7328191

PGP signature

Reply via email to