[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <8ebbd7f504081710087f469bc@mail.gmail.com>
From: dentonj at gmail.com (Jeffrey Denton)
Subject: Unix Commands
On Sat, 14 Aug 2004 07:07:05 -0700, Seth Alan Woolley
<seth@...tology.org> wrote:
> Bash supports sockets directly. Read the man page under redirection:
>
> /dev/tcp/host/port
> If host is a valid hostname or Internet address, and port
> is an integer port number or service name, bash attempts
> to open a TCP connection to the corresponding socket.
> /dev/udp/host/port
> If host is a valid hostname or Internet address, and port
> is an integer port number or service name, bash attempts
> to open a UDP connection to the corresponding socket.
http://www.tldp.org/LDP/abs/html/devref1.html
An example from that page:
$ exec 5<>/dev/tcp/www.slashdot.org/80
$ echo -e "GET / HTTP/1.0\n" >&5
$ cat <&5
HTTP/1.1 301 Moved Permanently
Date: Tue, 17 Aug 2004 17:04:28 GMT
Server: Apache/1.3.29 (Unix) mod_gzip/1.3.26.1a mod_perl/1.29
Location: http://slashdot.org/
Connection: close
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>301 Moved Permanently</TITLE>
</HEAD><BODY>
<H1>Moved Permanently</H1>
The document has moved <A HREF="http://slashdot.org/">here</A>.<P>
<HR>
<ADDRESS>Apache/1.3.29 Server at www.slashdot.org Port 8080</ADDRESS>
</BODY></HTML>
netcat is still a better answer.
Powered by blists - more mailing lists