[ILUG] Bash & network programming...
waider at dspsrv.com
Tue Jan 15 15:27:43 GMT 2002
According to John Madden:
> On Tue, 15 Jan 2002 John P. Looney didst pronounce:
> > Any idea how to get a web page down with bash ?
> > I tried;
> >echo "GET / HTTP/1.0\n\n"| cat < /dev/tcp/172.24.1.104/80 > /dev/tcp/172.24.1.104/80
> > with no luck. (172.24.1.104 being a webserver).
> Would lynx -source do what you want?
Or wget? Or links -dump? or netcat?
I'd guess that the problem with the above is one of
(a) asynchronicity (is that a word?) - you're trying to get cat to read
stdin and a redirect at the same time, for one thing, and for another,
are you guaranteed that the < and > connect as you'd expect?
(b) HTTP specifies CRLF as line endings, not LF on its own. Of course, most
things don't really care about this, but.
waider at dspsrv.com / Chances are I'm not at home right now.
More information about the ILUG