zsh-users
 help / color / mirror / code / Atom feed
* pure zsh implementation of wget
@ 2011-09-22 21:06 Guido van Steen
  2011-09-22 21:50 ` Mikael Magnusson
  2011-09-22 21:53 ` Stephane Bortzmeyer
  0 siblings, 2 replies; 16+ messages in thread
From: Guido van Steen @ 2011-09-22 21:06 UTC (permalink / raw)
  To: zsh-users

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 



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2011-09-27  9:09 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-22 21:06 pure zsh implementation of wget Guido van Steen
2011-09-22 21:50 ` Mikael Magnusson
2011-09-23  5:23   ` Guido van Steen
2011-09-23  6:57     ` Mikael Magnusson
2011-09-23  7:13       ` Guido van Steen
2011-09-23 12:06         ` Guillaume Brunerie
2011-09-23 12:12           ` İsmail Dönmez
2011-09-23  7:01     ` Bart Schaefer
2011-09-23  7:16       ` Guido van Steen
2011-09-27  9:02     ` Oliver Kiddle
2011-09-24 16:49   ` Guido van Steen
2011-09-24 17:58     ` Bart Schaefer
2011-09-24 20:23       ` Guido van Steen
2011-09-24 21:11         ` Guido van Steen
2011-09-24 21:42         ` Bart Schaefer
2011-09-22 21:53 ` Stephane Bortzmeyer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).