Bash, Shell, PHP, Python, Perl, CGI
-
alexander newald
- Posts: 1117
- Joined: 2002-09-27 00:54
- Location: Hannover
-
Post
by alexander newald »
Hallo,
kann man (und wenn ja wie

) die Grösse eines Downloads
vor dem Download nur mit einem Shellskript und wget bestimmen?
Danke
Alexander Newald
-
[tom]
- Posts: 656
- Joined: 2003-01-08 20:10
- Location: Berlin
-
Post
by [tom] »
Also wenn es nicht unbeding wget sein muß, würd ich es mit curl machen.
Code: Select all
curl -I ftp://ftp.de.debian.org/debian-cd/images/current/i386/debian-30r1-i386-binary-1.iso
Bei FTP gibt es nur die Größe, bei HTTP auch noch ein bisschen mehr Header. ;-)
[TOM]
-
[tom]
- Posts: 656
- Joined: 2003-01-08 20:10
- Location: Berlin
-
Post
by [tom] »
Ach ja. Damit der geneigte Leser sich die Man-Pages spart:
Code: Select all
curl -I -s ftp://ftp.de.debian.org/debian-cd/images/current/i386/debian-30r1-i386-binary-1.iso | grep -i "^Content-Length" | cut -d " " -f 2
Das liefert dann nur die Größe, sofern vorhanden. Manche PHP Scripte (wie z. B. phpBB) liefern kein Content-Length im Header mit. :-/
[TOM]