使い道あるかわからないけれど、/dev/tcp/{hostname}/{port}
で TCP 通信できる。(※ただし bash に限る?)
http_client.sh
#!/bin/bash
# 使い方
# $ ./http_client.sh host path
# http://host/path に GET 投げる
exec 3<> /dev/tcp/$1/80
echo -e "GET $2 HTTP/1.0\n\n" >&3
cat <&3
実行してみる。
$ ./http_client.sh qiita.com /
HTTP/1.1 200 OK
Server: nginx/1.0.9
Date: Wed, 22 Feb 2012 01:19:59 GMT
Content-Type: text/html
Content-Length: 151
Last-Modified: Tue, 01 Nov 2011 15:07:17 GMT
Connection: close
Accept-Ranges: bytes
<html>
<head>
<title>Welcome to nginx!</title>
</head>
<body bgcolor="white" text="black">
<center><h1>Welcome to nginx!</h1></center>
</body>
</html>
$
ちなみに /dev/udp/{hostname}/{port}
で UDP 通信。