The following example is a useful demonstration for sockets in Bash. This is exclusive to Bash, so don't expect this code to be portable to any other shell interpreter.
#!/bin/env bash exec 3<>/dev/tcp/www.secnix.com/80 echo -e "GET /blog/justin/atom.xml HTTP/1.1\nHost: www.secnix.com\n\n" >&3 cat <&3 exec 3<&-
Running the above code yields something like the following. Not bad for those with aspirations of writing their own Bash-based browser.
[jc@ldesktop ~]$ ./get_html.sh
HTTP/1.1 200 OK
Date: Fri, 29 Aug 2008 18:53:20 GMT
Server: Apache/2.2.9 (FreeBSD)
Last-Modified: Wed, 27 Aug 2008 12:27:21 GMT
ETag: "7e832-3fe9-4557024539c40"
Accept-Ranges: bytes
Content-Length: 16361
Content-Type: application/xml
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Justin</title>
<link rel="alternate" type="text/html"
href="http://www.secnix.com/blog/justin/" />
<link rel="self" type="application/atom+xml"
href="http://www.secnix.com/blog/justin/atom.xml" />
<id>tag:www.secnix.com,2008-08-18:/blog/justin//1</id>
<updated>2008-08-27T12:25:57Z</updated>
<generator uri="http://www.sixapart.com/movabletype/">
Movable Type 4.2-en</generator>
<entry>
<title>Sensible Link Management in Movable Type</title>
...