Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
pure zsh implementation of wget
- X-seq: zsh-users 16396
- From: Guido van Steen <gvsteen@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: pure zsh implementation of wget
- Date: Thu, 22 Sep 2011 14:06:40 -0700 (PDT)
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1316725600; bh=QbK5jV44UM/35D/bytAaUZA8E6bYVkakCSOt26YLcog=; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=tSteF9L3Iy9WKnCNBGQ8zFUD5QysxgPP2MycN5PNX0xlU/yGRoQMOd5NNiBtof6Kt6o3faBhNwS9Ij/ctNDrW1x6FWjHa6ZF/d3+N+AJfBBsEzL2PLNeBjbn/duQIMecgb0+9IpDYugDHCu1KSENvkH5htRtVQhPX6Mc1qPF9bI=
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=AGrK0raedAvETRLZwhDU9oGjAL1VA8l8FUnyuSGpN+eUIs3iOqITGcZGpo6J25/Zk0VlX+eiDiUh8OoYQlKIZOcaS94uWCK0710p9Rl3L1TB47iIqFmFm8B5NnKJkvhDqNYx6FN0ZlCR2g+udlIzJ6pdvNRuXYp5xEspFKGvalw=;
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
Hi!
I was wondering if someone could point me to a pure zsh implementation of a function/script that downloads files like wget.
I have been look at this (slightly modified from http://rosettacode.org/wiki/HTTP#Zsh):
$cat wget.zsh
#!/usr/bin/env zsh
zmodload zsh/net/tcp
ztcp google.com 80
fd=$REPLY
print -l -u $fd -- 'GET / HTTP/1.1' 'Host: google.com' ''
while read -u $fd -r -e -t 1; do; :; done
ztcp -c $fd
However, when I run this script, I do not receive any files. Neither do I observe any other results. I tried it with other sites, e.g. replacing google.com by localhost, and so on.
Does someone know what am I missing?
BTW, would this work with https as well?
Thanks in advance!
Guido
Messages sorted by:
Reverse Date,
Date,
Thread,
Author