From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24043 invoked by alias); 22 Sep 2011 21:13:31 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16396 Received: (qmail 16572 invoked from network); 22 Sep 2011 21:13:19 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, T_TO_NO_BRKTS_FREEMAIL autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at yahoo.com does not designate permitted sender hosts) X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 95283.69081.bm@omp1068.mail.ac4.yahoo.com 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=; X-YMail-OSG: 5bmAwz0VM1nn8jI0PHxnk0D7sgsIBgoR2hr53cg1OA7nSRR gvwNEGT5br_JSNyJ4A2A8CE85tp9RgcDh62EvG3pCJ8vUZo6hOEYNBbiQptZ lbnryGDwCVBYopdVMjmHD.rgMbuhbgQItmDnCDULnCRJIJGOjY5GOyW4Mg8Y L3Y.XUlU_H12qPGtloU7l0JAR7WWAY5zIt.W_96TTQ6aUM2tfzfYiHPIFIjX UbuCPIpxxMvz3TCY_1V16t5q3y5PVodxw9ffG_OioCN.vKmmt4aYZxPSiCuc VemeR4l64gbSU7afm41YJwUdHaxykjolufP58J8KU5ttorZ4Qvhe4Uqqm49N j.uzRmedKhw1IqqTtMMFaHOjP8DL9BBFao02sMzhWHtUEUm2_8eTCDiHOVpJ l4esogQAMb8KwPT0zz5aHPOhhOn1WPCdZ9BGMEfviiAoOOhCJuBXpHLr6_7T QqC8Yz4hmMANbIszK1sq7v5iEZD4y9QVEYdXb4CEJqZeeYauLcuu3MYHkaSJ 02dYnsPt_IbwjxG6oBCNk3mdOnWoqHKt5eqF1Y0LGPuTdriisa8aysyXX4GV IpjWp0Hgt X-Mailer: YahooMailClassic/14.0.5 YahooMailWebService/0.8.113.315625 Message-ID: <1316725600.8003.YahooMailClassic@web65605.mail.ac4.yahoo.com> Date: Thu, 22 Sep 2011 14:06:40 -0700 (PDT) From: Guido van Steen Subject: pure zsh implementation of wget To: zsh-users@zsh.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi! =0A=0AI was wondering if someone could point me to a pure zsh implement= ation of a function/script that downloads files like wget. =0A=0AI have bee= n look at this (slightly modified from http://rosettacode.org/wiki/HTTP#Zsh= ): =0A=0A$cat wget.zsh=0A#!/usr/bin/env zsh=0Azmodload zsh/net/tcp=0Aztcp g= oogle.com 80=0Afd=3D$REPLY=0Aprint -l -u $fd -- 'GET / HTTP/1.1' 'Host: goo= gle.com' ''=0Awhile read -u $fd -r -e -t 1; do; :; done=0Aztcp -c $fd=0A=0A= However, when I run this script, I do not receive any files. Neither do I o= bserve any other results. I tried it with other sites, e.g. replacing googl= e.com by localhost, and so on. =0A=0ADoes someone know what am I missing? = =0A=0ABTW, would this work with https as well? =0A=0AThanks in advance! =0A= =0AGuido =0A