aboutsummaryrefslogtreecommitdiffstats
path: root/doc/gawkinet.info
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2010-07-16 14:49:57 +0300
committerArnold D. Robbins <arnold@skeeve.com>2010-07-16 14:49:57 +0300
commit6a2caf2157d87b4b582b2494bdd7d6a688dd0b1f (patch)
tree9a2862cc11be4832f188cfbdce175120ceba5024 /doc/gawkinet.info
parent315bd501ca696bc3e3c938b4604d8dac7a6f512f (diff)
downloadegawk-6a2caf2157d87b4b582b2494bdd7d6a688dd0b1f.tar.gz
egawk-6a2caf2157d87b4b582b2494bdd7d6a688dd0b1f.tar.bz2
egawk-6a2caf2157d87b4b582b2494bdd7d6a688dd0b1f.zip
Move to gawk-3.1.6.
Diffstat (limited to 'doc/gawkinet.info')
-rw-r--r--doc/gawkinet.info1527
1 files changed, 752 insertions, 775 deletions
diff --git a/doc/gawkinet.info b/doc/gawkinet.info
index 3c23e3c5..a496f6a2 100644
--- a/doc/gawkinet.info
+++ b/doc/gawkinet.info
@@ -1,12 +1,11 @@
-This is gawkinet.info, produced by makeinfo version 4.6 from
-gawkinet.texi.
-
INFO-DIR-SECTION Network applications
START-INFO-DIR-ENTRY
+This is gawkinet.info, produced by makeinfo version 4.11 from gawkinet.texi.
+
* Gawkinet: (gawkinet). TCP/IP Internetworking With `gawk'.
END-INFO-DIR-ENTRY
-This is Edition 1.1 of `TCP/IP Internetworking With `gawk'', for the
+ This is Edition 1.1 of `TCP/IP Internetworking With `gawk'', for the
3.1.4 (or later) version of the GNU implementation of AWK.
@@ -29,7 +28,7 @@ texts being (a) (see below), and with the Back-Cover Texts being (b)
This file documents the networking features in GNU `awk'.
-This is Edition 1.1 of `TCP/IP Internetworking With `gawk'', for the
+ This is Edition 1.1 of `TCP/IP Internetworking With `gawk'', for the
3.1.4 (or later) version of the GNU implementation of AWK.
@@ -59,7 +58,7 @@ General Introduction
This file documents the networking features in GNU Awk (`gawk') version
3.1 and later.
-This is Edition 1.1 of `TCP/IP Internetworking With `gawk'', for the
+ This is Edition 1.1 of `TCP/IP Internetworking With `gawk'', for the
3.1.4 (or later) version of the GNU implementation of AWK.
@@ -83,7 +82,7 @@ texts being (a) (see below), and with the Back-Cover Texts being (b)
* Menu:
* Preface:: About this document.
-* Introduction:: About networkiing.
+* Introduction:: About networking.
* Using Networking:: Some examples.
* Some Applications and Techniques:: More extended examples.
* Links:: Where to find the stuff mentioned in this
@@ -167,7 +166,7 @@ File: gawkinet.info, Node: Introduction, Next: Using Networking, Prev: Prefac
1 Networking Concepts
*********************
-This major node provides a (necessarily) brief intoduction to computer
+This major node provides a (necessarily) brief introduction to computer
networking concepts. For many applications of `gawk' to TCP/IP
networking, we hope that this is enough. For more advanced tasks, you
will need deeper background, and it may be necessary to switch to
@@ -301,7 +300,7 @@ IP
UDP
The User Datagram Protocol. This is a best effort datagram
protocol. It provides a small amount of extra reliability over
- IP, and adds the notion of "ports", described in *Note TCP and UDP
+ IP, and adds the notion of "ports", described in *note TCP and UDP
Ports: Ports.
TCP
@@ -394,8 +393,8 @@ the following table, where an "X" indicates that the given action
blocks.
TCP X X
-UDP X
-RAW X
+UDP X
+RAW X
---------- Footnotes ----------
@@ -460,7 +459,7 @@ File: gawkinet.info, Node: Gawk Special Files, Next: TCP Connecting, Prev: Us
==================================
The `|&' operator introduced in `gawk' 3.1 for use in communicating
-with a "coprocess" is described in *Note Two-way Communications With
+with a "coprocess" is described in *note Two-way Communications With
Another Process: (gawk)Two-way I/O. It shows how to do two-way I/O to a
separate process, sending it data with `print' or `printf' and reading
data with `getline'. If you haven't read it already, you should detour
@@ -487,10 +486,10 @@ fields, all of which are mandatory:
/inet/PROTOCOL/LOCALPORT/HOSTNAME/REMOTEPORT
-The `/inet/' field is, of course, constant when accessing the network.
-The LOCALPORT and REMOTEPORT fields do not have a meaning when used
-with `/inet/raw' because "ports" only apply to TCP and UDP. So, when
-using `/inet/raw', the port fields always have to be `0'.
+ The `/inet/' field is, of course, constant when accessing the
+network. The LOCALPORT and REMOTEPORT fields do not have a meaning
+when used with `/inet/raw' because "ports" only apply to TCP and UDP.
+So, when using `/inet/raw', the port fields always have to be `0'.
* Menu:
@@ -546,13 +545,13 @@ REMOTEPORT
Instead they specify a local port to which clients connect. It is
possible to use a name from `/etc/services' here.
-Experts in network programming will notice that the usual client/server
-asymmetry found at the level of the socket API is not visible here.
-This is for the sake of simplicity of the high-level concept. If this
-asymmetry is necessary for your application, use another language. For
-`gawk', it is more important to enable users to write a client program
-with a minimum of code. What happens when first accessing a network
-connection is seen in the following pseudocode:
+ Experts in network programming will notice that the usual
+client/server asymmetry found at the level of the socket API is not
+visible here. This is for the sake of simplicity of the high-level
+concept. If this asymmetry is necessary for your application, use
+another language. For `gawk', it is more important to enable users to
+write a client program with a minimum of code. What happens when first
+accessing a network connection is seen in the following pseudocode:
if ((name of remote host given) && (other side accepts connection)) {
rendez-vous successful; transmit with getline or print
@@ -566,54 +565,40 @@ connection is seen in the following pseudocode:
ready
}
-The exact behavior of this algorithm depends on the values of the
-fields of the special file name. When in doubt, *Note
+ The exact behavior of this algorithm depends on the values of the
+fields of the special file name. When in doubt, *note
table-inet-components:: gives you the combinations of values and their
meaning. If this table is too complicated, focus on the three lines
-printed in *bold*. All the examples in *Note Networking With `gawk':
+printed in *bold*. All the examples in *note Networking With `gawk':
Using Networking, use only the patterns printed in bold letters.
PROTOCOL LOCAL PORT HOST NAME REMOTE RESULTING CONNECTION-LEVEL
PORT BEHAVIOR
-------------------------------------------------------------------------------
+------------------------------------------------------------------------------
*tcp* *0* *x* *x* *Dedicated client, fails if
immediately connecting to a
server on the
other side fails*
-------------------------------------------------------------------------------
udp 0 x x Dedicated client
-------------------------------------------------------------------------------
raw 0 x 0 Dedicated client, works only
as `root'
-------------------------------------------------------------------------------
*tcp, udp* *x* *x* *x* *Client, switches to
dedicated server if
necessary*
-------------------------------------------------------------------------------
*tcp, udp* *x* *0* *0* *Dedicated server*
-------------------------------------------------------------------------------
raw 0 0 0 Dedicated server, works only
as `root'
-------------------------------------------------------------------------------
tcp, udp, x x 0 Invalid
-raw
-------------------------------------------------------------------------------
+raw
tcp, udp, 0 0 x Invalid
-raw
-------------------------------------------------------------------------------
+raw
tcp, udp, x 0 x Invalid
-raw
-------------------------------------------------------------------------------
+raw
tcp, udp 0 0 0 Invalid
-------------------------------------------------------------------------------
tcp, udp 0 x 0 Invalid
-------------------------------------------------------------------------------
raw x 0 0 Invalid
-------------------------------------------------------------------------------
raw 0 x x Invalid
-------------------------------------------------------------------------------
raw x x x Invalid
-------------------------------------------------------------------------------
Table 2.1: /inet Special File Components
@@ -654,7 +639,7 @@ sender program:
close("/inet/tcp/8888/0/0")
}
-The receiver is very simple:
+ The receiver is very simple:
# Client
BEGIN {
@@ -663,7 +648,7 @@ The receiver is very simple:
close("/inet/tcp/0/localhost/8888")
}
-TCP guarantees that the bytes arrive at the receiving end in exactly
+ TCP guarantees that the bytes arrive at the receiving end in exactly
the same order that they were sent. No byte is lost (except for broken
connections), doubled, or out of order. Some overhead is necessary to
accomplish this, but this is the price to pay for a reliable service.
@@ -688,7 +673,7 @@ started first:
close("/inet/udp/8888/0/0")
}
-The receiver is almost identical to the TCP receiver:
+ The receiver is almost identical to the TCP receiver:
# Client
BEGIN {
@@ -697,7 +682,7 @@ The receiver is almost identical to the TCP receiver:
close("/inet/udp/0/localhost/8888")
}
-UDP cannot guarantee that the datagrams at the receiving end will
+ UDP cannot guarantee that the datagrams at the receiving end will
arrive in exactly the same order they were sent. Some datagrams could be
lost, some doubled, and some out of order. But no overhead is necessary
to accomplish this. This unreliable behavior is good enough for tasks
@@ -716,7 +701,7 @@ case, the sender has to supply the encapsulating header bytes in front
of the packet and the receiver has to strip the additional bytes from
the message.
-RAW receivers cannot receive packets sent with TCP or UDP because the
+ RAW receivers cannot receive packets sent with TCP or UDP because the
operating system does not deliver the packets to a RAW receiver. The
operating system knows about some of the protocols on top of IP and
decides on its own which packet to deliver to which process. (d.c.)
@@ -724,7 +709,7 @@ Therefore, the UDP receiver must be used for receiving UDP datagrams
sent with the RAW sender. This is a dark corner, not only of `gawk',
but also of TCP/IP.
-For extended experimentation with protocols, look into the approach
+ For extended experimentation with protocols, look into the approach
implemented in a tool called SPAK. This tool reflects the hierarchical
layering of protocols (encapsulation) in the way data streams are piped
out of one program into the next one. It shows which protocol is based
@@ -733,9 +718,9 @@ ordering of the program calls. Cleverly thought out, SPAK is much
better than `gawk''s `/inet' for learning the meaning of each and every
bit in the protocol headers.
-The next example uses the RAW protocol to emulate the behavior of UDP.
-The sender program is the same as above, but with some additional bytes
-that fill the places of the UDP fields:
+ The next example uses the RAW protocol to emulate the behavior of
+UDP. The sender program is the same as above, but with some additional
+bytes that fill the places of the UDP fields:
BEGIN {
Message = "Hello world\n"
@@ -752,7 +737,7 @@ that fill the places of the UDP fields:
close(RawService)
}
-Since this program tries to emulate the behavior of UDP, it checks if
+ Since this program tries to emulate the behavior of UDP, it checks if
the RAW sender is understood by the UDP receiver but not if the RAW
receiver can understand the UDP sender. In a real network, the RAW
receiver is hardly of any use because it gets every IP packet that
@@ -761,15 +746,15 @@ would be too slow for processing them. Only on a network with little
traffic can the IP-level receiver program be tested. Programs for
analyzing IP traffic on modem or ISDN channels should be possible.
-Port numbers do not have a meaning when using `/inet/raw'. Their fields
-have to be `0'. Only TCP and UDP use ports. Receiving data from
+ Port numbers do not have a meaning when using `/inet/raw'. Their
+fields have to be `0'. Only TCP and UDP use ports. Receiving data from
`/inet/raw' is difficult, not only because of processing speed but also
because data is usually binary and not restricted to ASCII. This
implies that line separation with `RS' does not work as usual.
----------- Footnotes ----------
+ ---------- Footnotes ----------
-(1) This special file is reserved, but not otherwise currently
+ (1) This special file is reserved, but not otherwise currently
implemented.

@@ -789,7 +774,7 @@ the service `daytime' on the machine what time it is:
close("/inet/tcp/0/localhost/daytime")
}
-Even experienced `awk' users will find the second line strange in two
+ Even experienced `awk' users will find the second line strange in two
respects:
* A special file is used as a shell command that pipes its output
@@ -802,12 +787,12 @@ respects:
language needed (apart from the special files) to introduce
network access.
-The `|&' operator was introduced in `gawk' 3.1 in order to overcome the
-crucial restriction that access to files and pipes in `awk' is always
-unidirectional. It was formerly impossible to use both access modes on
-the same file or pipe. Instead of changing the whole concept of file
-access, the `|&' operator behaves exactly like the usual pipe operator
-except for two additions:
+ The `|&' operator was introduced in `gawk' 3.1 in order to overcome
+the crucial restriction that access to files and pipes in `awk' is
+always unidirectional. It was formerly impossible to use both access
+modes on the same file or pipe. Instead of changing the whole concept
+of file access, the `|&' operator behaves exactly like the usual pipe
+operator except for two additions:
* Normal shell commands connected to their `gawk' program with a `|&'
pipe can be accessed bidirectionally. The `|&' turns out to be a
@@ -817,7 +802,7 @@ except for two additions:
are not executed as shell commands. Instead, they can be read and
written to, just like a full-duplex network connection.
-In the earlier example, the `|&' operator tells `getline' to read a
+ In the earlier example, the `|&' operator tells `getline' to read a
line from the special file `/inet/tcp/0/localhost/daytime'. We could
also have printed a line into the special file. But instead we just
read a line with the time, printed it, and closed the connection.
@@ -879,27 +864,28 @@ a look at your `/etc/services' file. It could look like this:
irc 194/udp
...
-Here, you find a list of services that traditional Unix machines usually
-support. If your GNU/Linux machine does not do so, it may be that these
-services are switched off in some startup script. Systems running some
-flavor of Microsoft Windows usually do _not_ support these services.
-Nevertheless, it _is_ possible to do networking with `gawk' on Microsoft
-Windows.(1) The first column of the file gives the name of the service,
-and the second column gives a unique number and the protocol that one
-can use to connect to this service. The rest of the line is treated as
-a comment. You see that some services (`echo') support TCP as well as
-UDP.
-
----------- Footnotes ----------
-
-(1) Microsoft prefered to ignore the TCP/IP family of protocols until
-1995. Then came the rise of the Netscape browser as a landmark "killer
-application." Microsoft added TCP/IP support and their own browser to
-Microsoft Windows 95 at the last minute. They even back-ported their
-TCP/IP implementation to Microsoft Windows for Workgroups 3.11, but it
-was a rather rudimentary and half-hearted implementation. Nevertheless,
-the equivalent of `/etc/services' resides under
-`C:\WINNT\system32\drivers\etc\services' on Microsoft Windows 2000.
+ Here, you find a list of services that traditional Unix machines
+usually support. If your GNU/Linux machine does not do so, it may be
+that these services are switched off in some startup script. Systems
+running some flavor of Microsoft Windows usually do _not_ support these
+services. Nevertheless, it _is_ possible to do networking with `gawk'
+on Microsoft Windows.(1) The first column of the file gives the name of
+the service, and the second column gives a unique number and the
+protocol that one can use to connect to this service. The rest of the
+line is treated as a comment. You see that some services (`echo')
+support TCP as well as UDP.
+
+ ---------- Footnotes ----------
+
+ (1) Microsoft preferred to ignore the TCP/IP family of protocols
+until 1995. Then came the rise of the Netscape browser as a landmark
+"killer application." Microsoft added TCP/IP support and their own
+browser to Microsoft Windows 95 at the last minute. They even
+back-ported their TCP/IP implementation to Microsoft Windows for
+Workgroups 3.11, but it was a rather rudimentary and half-hearted
+implementation. Nevertheless, the equivalent of `/etc/services' resides
+under `C:\WINNT\system32\drivers\etc\services' on Microsoft Windows
+2000.

File: gawkinet.info, Node: Interacting, Next: Setting Up, Prev: Troubleshooting, Up: Using Networking
@@ -921,14 +907,14 @@ name in your local network:
close(NetService)
}
-After telling the service on the machine which user to look for, the
+ After telling the service on the machine which user to look for, the
program repeatedly reads lines that come as a reply. When no more lines
are coming (because the service has closed the connection), the program
also closes the connection. Try replacing `"NAME"' with your login name
(or the name of someone else logged in). For a list of all users
currently logged in, replace NAME with an empty string (`""').
-The final `close' command could be safely deleted from the above
+ The final `close' command could be safely deleted from the above
script, because the operating system closes any open connection by
default when a script reaches the end of execution. In order to avoid
portability problems, it is best to always close connections explicitly.
@@ -936,18 +922,18 @@ With the Linux kernel, for example, proper closing results in flushing
of buffers. Letting the close happen by default may result in
discarding buffers.
-When looking at `/etc/services' you may have noticed that the `daytime'
-service is also available with `udp'. In the earlier example, change
-`tcp' to `udp', and change `finger' to `daytime'. After starting the
-modified program, you see the expected day and time message. The
-program then hangs, because it waits for more lines coming from the
-service. However, they never come. This behavior is a consequence of the
-differences between TCP and UDP. When using UDP, neither party is
-automatically informed about the other closing the connection.
-Continuing to experiment this way reveals many other subtle differences
-between TCP and UDP. To avoid such trouble, one should always remember
-the advice Douglas E. Comer and David Stevens give in Volume III of
-their series `Internetworking With TCP' (page 14):
+ When looking at `/etc/services' you may have noticed that the
+`daytime' service is also available with `udp'. In the earlier example,
+change `tcp' to `udp', and change `finger' to `daytime'. After
+starting the modified program, you see the expected day and time
+message. The program then hangs, because it waits for more lines
+coming from the service. However, they never come. This behavior is a
+consequence of the differences between TCP and UDP. When using UDP,
+neither party is automatically informed about the other closing the
+connection. Continuing to experiment this way reveals many other subtle
+differences between TCP and UDP. To avoid such trouble, one should
+always remember the advice Douglas E. Comer and David Stevens give in
+Volume III of their series `Internetworking With TCP' (page 14):
When designing client-server applications, beginners are strongly
advised to use TCP because it provides reliable,
@@ -969,32 +955,32 @@ a server does not know in advance who is going to connect to it over
the network. Therefore, we cannot insert a name for the host to connect
to in our special file name.
-Start the following program in one window. Notice that the service does
-not have the name `daytime', but the number `8888'. From looking at
-`/etc/services', you know that names like `daytime' are just mnemonics
-for predetermined 16-bit integers. Only the system administrator
-(`root') could enter our new service into `/etc/services' with an
-appropriate name. Also notice that the service name has to be entered
-into a different field of the special file name because we are setting
-up a server, not a client:
+ Start the following program in one window. Notice that the service
+does not have the name `daytime', but the number `8888'. From looking
+at `/etc/services', you know that names like `daytime' are just
+mnemonics for predetermined 16-bit integers. Only the system
+administrator (`root') could enter our new service into `/etc/services'
+with an appropriate name. Also notice that the service name has to be
+entered into a different field of the special file name because we are
+setting up a server, not a client:
BEGIN {
print strftime() |& "/inet/tcp/8888/0/0"
close("/inet/tcp/8888/0/0")
}
-Now open another window on the same machine. Copy the client program
-given as the first example (*note Establishing a TCP Connection: TCP
-Connecting.) to a new file and edit it, changing the name `daytime' to
-`8888'. Then start the modified client. You should get a reply like
-this:
+ Now open another window on the same machine. Copy the client
+program given as the first example (*note Establishing a TCP
+Connection: TCP Connecting.) to a new file and edit it, changing the
+name `daytime' to `8888'. Then start the modified client. You should
+get a reply like this:
Sat Sep 27 19:08:16 CEST 1997
Both programs explicitly close the connection.
-Now we will intentionally make a mistake to see what happens when the
-name `8888' (the so-called port) is already used by another service.
+ Now we will intentionally make a mistake to see what happens when
+the name `8888' (the so-called port) is already used by another service.
Start the server program in both windows. The first one works, but the
second one complains that it could not open the connection. Each port
on a single machine can only be used by one server program at a time.
@@ -1008,7 +994,7 @@ running some flavor of Microsoft Windows, there is no restriction that
reserves ports 1 to 1024 for a privileged user; hence, you can start an
`echo' server there.
-Turning this short server program into something really useful is
+ Turning this short server program into something really useful is
simple. Imagine a server that first reads a file name from the client
through the network connection, then does something with the file and
sends a result back to the client. The server-side processing could be:
@@ -1042,7 +1028,7 @@ that communicate with your machine using special protocols. To receive
email, we will use the Post Office Protocol (POP). Sending can be done
with the much older Simple Mail Transfer Protocol (SMTP).
-When you type in the following program, replace the EMAILHOST by the
+ When you type in the following program, replace the EMAILHOST by the
name of your local email server. Ask your administrator if the server
has a POP service, and then use its name or number in the program below.
Now the program is ready to connect to your email server, but it will
@@ -1067,19 +1053,19 @@ the first email the server has in store:
close(POPService)
}
-The record separators `RS' and `ORS' are redefined because the protocol
-(POP) requires CR-LF to separate lines. After identifying yourself to
-the email service, the command `retr 1' instructs the service to send
-the first of all your email messages in line. If the service replies
-with something other than `+OK', the program exits; maybe there is no
-email. Otherwise, the program first announces that it intends to finish
-reading email, and then redefines `RS' in order to read the entire
-email as multiline input in one record. From the POP RFC, we know that
-the body of the email always ends with a single line containing a
-single dot. The program looks for this using `RS = "\r\n\\.\r\n"'.
-When it finds this sequence in the mail message, it quits. You can
-invoke this program as often as you like; it does not delete the
-message it reads, but instead leaves it on the server.
+ The record separators `RS' and `ORS' are redefined because the
+protocol (POP) requires CR-LF to separate lines. After identifying
+yourself to the email service, the command `retr 1' instructs the
+service to send the first of all your email messages in line. If the
+service replies with something other than `+OK', the program exits;
+maybe there is no email. Otherwise, the program first announces that it
+intends to finish reading email, and then redefines `RS' in order to
+read the entire email as multiline input in one record. From the POP
+RFC, we know that the body of the email always ends with a single line
+containing a single dot. The program looks for this using `RS =
+"\r\n\\.\r\n"'. When it finds this sequence in the mail message, it
+quits. You can invoke this program as often as you like; it does not
+delete the message it reads, but instead leaves it on the server.

File: gawkinet.info, Node: Web page, Next: Primitive Service, Prev: Email, Up: Using Networking
@@ -1095,12 +1081,12 @@ As in the preceding node, ask your administrator about the name of your
local web server or proxy web server and its port number for HTTP
requests.
-The following program employs a rather crude approach toward retrieving
-a web page. It uses the prehistoric syntax of HTTP 0.9, which almost all
-web servers still support. The most noticeable thing about it is that
-the program directs the request to the local proxy server whose name
-you insert in the special file name (which in turn calls
-`www.yahoo.com'):
+ The following program employs a rather crude approach toward
+retrieving a web page. It uses the prehistoric syntax of HTTP 0.9,
+which almost all web servers still support. The most noticeable thing
+about it is that the program directs the request to the local proxy
+server whose name you insert in the special file name (which in turn
+calls `www.yahoo.com'):
BEGIN {
RS = ORS = "\r\n"
@@ -1111,7 +1097,7 @@ you insert in the special file name (which in turn calls
close(HttpService)
}
-Again, lines are separated by a redefined `RS' and `ORS'. The `GET'
+ Again, lines are separated by a redefined `RS' and `ORS'. The `GET'
request that we send to the server is the only kind of HTTP request
that existed when the web was created in the early 1990s. HTTP calls
this `GET' request a "method," which tells the service to transmit a
@@ -1121,13 +1107,13 @@ HTTP is 1.1,(1) and knows the additional request methods `OPTIONS',
`PUT', `DELETE', and `TRACE'. You can fill in any valid web address,
and the program prints the HTML code of that page to your screen.
-Notice the similarity between the responses of the POP and HTTP
+ Notice the similarity between the responses of the POP and HTTP
services. First, you get a header that is terminated by an empty line,
and then you get the body of the page in HTML. The lines of the
headers also have the same form as in POP. There is the name of a
parameter, then a colon, and finally the value of that parameter.
-Images (`.png' or `.gif' files) can also be retrieved this way, but
+ Images (`.png' or `.gif' files) can also be retrieved this way, but
then you get binary data that should be redirected into a file. Another
application is calling a CGI (Common Gateway Interface) script on some
server. CGI scripts are used when the contents of a web page are not
@@ -1139,11 +1125,11 @@ following:
get = "GET http://quote.yahoo.com/q?s=MOT&d=t"
print get |& HttpService
-You can also request weather reports this way.
+ You can also request weather reports this way.
----------- Footnotes ----------
+ ---------- Footnotes ----------
-(1) Version 1.0 of HTTP was defined in RFC 1945. HTTP 1.1 was
+ (1) Version 1.0 of HTTP was defined in RFC 1945. HTTP 1.1 was
initially specified in RFC 2068. In June 1999, RFC 2068 was made
obsolete by RFC 2616, an update without any substantial changes.
@@ -1162,8 +1148,8 @@ number in the `localport' field of the special file name. The other two
fields (HOSTNAME and REMOTEPORT) have to contain a `0' because we do
not know in advance which host will connect to our service.
-In the early 1990s, all a server had to do was send an HTML document and
-close the connection. Here, we adhere to the modern syntax of HTTP.
+ In the early 1990s, all a server had to do was send an HTML document
+and close the connection. Here, we adhere to the modern syntax of HTTP.
The steps are as follows:
1. Send a status line telling the web browser that everything is okay.
@@ -1198,12 +1184,12 @@ The steps are as follows:
close(HttpService)
}
-Now, on the same machine, start your favorite browser and let it point
-to `http://localhost:8080' (the browser needs to know on which port our
-server is listening for requests). If this does not work, the browser
-probably tries to connect to a proxy server that does not know your
-machine. If so, change the browser's configuration so that the browser
-does not try to use a proxy to connect to your machine.
+ Now, on the same machine, start your favorite browser and let it
+point to `http://localhost:8080' (the browser needs to know on which
+port our server is listening for requests). If this does not work, the
+browser probably tries to connect to a proxy server that does not know
+your machine. If so, change the browser's configuration so that the
+browser does not try to use a proxy to connect to your machine.

File: gawkinet.info, Node: Interacting Service, Next: Simple Server, Prev: Primitive Service, Up: Using Networking
@@ -1212,22 +1198,22 @@ File: gawkinet.info, Node: Interacting Service, Next: Simple Server, Prev: Pr
==================================
This node shows how to set up a simple web server. The subnode is a
-library file that we will use with all the examples in *Note Some
+library file that we will use with all the examples in *note Some
Applications and Techniques::.
* Menu:
* CGI Lib:: A simple CGI library.
-Setting up a web service that allows user interaction is more difficult
-and shows us the limits of network access in `gawk'. In this node, we
-develop a main program (a `BEGIN' pattern and its action) that will
-become the core of event-driven execution controlled by a graphical
-user interface (GUI). Each HTTP event that the user triggers by some
-action within the browser is received in this central procedure.
-Parameters and menu choices are extracted from this request, and an
-appropriate measure is taken according to the user's choice. For
-example:
+ Setting up a web service that allows user interaction is more
+difficult and shows us the limits of network access in `gawk'. In this
+node, we develop a main program (a `BEGIN' pattern and its action)
+that will become the core of event-driven execution controlled by a
+graphical user interface (GUI). Each HTTP event that the user triggers
+by some action within the browser is received in this central
+procedure. Parameters and menu choices are extracted from this request,
+and an appropriate measure is taken according to the user's choice.
+For example:
BEGIN {
if (MyHost == "") {
@@ -1274,7 +1260,7 @@ example:
}
}
-This web server presents menu choices in the form of HTML links.
+ This web server presents menu choices in the form of HTML links.
Therefore, it has to tell the browser the name of the host it is
residing on. When starting the server, the user may supply the name of
the host from the command line with `gawk -v MyHost="Rumpelstilzchen"'.
@@ -1283,7 +1269,7 @@ it is running on for later use as a web address in HTML documents. The
same applies to the port number. These values are inserted later into
the HTML content of the web pages to refer to the home system.
-Each server that is built around this core has to initialize some
+ Each server that is built around this core has to initialize some
application-dependent variables (such as the default home page) in a
procedure `SetUpServer', which is called immediately before entering the
infinite loop of the server. For now, we will write an instance that
@@ -1302,13 +1288,14 @@ in human-readable format or in seconds since 1970:
TopFooter = "</BODY></HTML>"
}
-On the first run through the main loop, the default line terminators are
-set and the default home page is copied to the actual home page. Since
-this is the first run, `GETARG["Method"]' is not initialized yet, hence
-the case selection over the method does nothing. Now that the home page
-is initialized, the server can start communicating to a client browser.
+ On the first run through the main loop, the default line terminators
+are set and the default home page is copied to the actual home page.
+Since this is the first run, `GETARG["Method"]' is not initialized yet,
+hence the case selection over the method does nothing. Now that the
+home page is initialized, the server can start communicating to a
+client browser.
-It does so by printing the HTTP header into the network connection
+ It does so by printing the HTTP header into the network connection
(`print ... |& HttpService'). This command blocks execution of the
server script until a client connects. If this server script is
compared with the primitive one we wrote before, you will notice two
@@ -1320,14 +1307,14 @@ the browser retrieves the time of day in the previous example just once,
and later it takes the web page from the cache, always displaying the
same time of day although time advances each second.
-Having supplied the initial home page to the browser with a valid
+ Having supplied the initial home page to the browser with a valid
document stored in the parameter `Prompt', it closes the connection and
waits for the next request. When the request comes, a log line is
printed that allows us to see which request the server receives. The
final step in the loop is to call the function `CGI_setup', which reads
all the lines of the request (coming from the browser), processes them,
and stores the transmitted parameters in the array `PARAM'. The complete
-text of these application-independent functions can be found in *Note A
+text of these application-independent functions can be found in *note A
Simple CGI Library: CGI Lib. For now, we use a simplified version of
`CGI_setup':
@@ -1351,8 +1338,8 @@ Simple CGI Library: CGI Lib. For now, we use a simplified version of
}
}
-At first, the function clears all variables used for global storage of
-request parameters. The rest of the function serves the purpose of
+ At first, the function clears all variables used for global storage
+of request parameters. The rest of the function serves the purpose of
filling the global parameters with the extracted new values. To
accomplish this, the name of the requested resource is split into parts
and stored for later evaluation. If the request contains a `?', then
@@ -1368,7 +1355,7 @@ working with the `POST' and `PUT' methods, reading the header and body
becomes inevitable. Header parameters should then be stored in a global
array as well as the body.
-On each subsequent run through the main loop, one request from a
+ On each subsequent run through the main loop, one request from a
browser is received, evaluated, and answered according to the user's
choice. This can be done by letting the value of the HTTP method guide
the main loop into execution of the procedure `HandleGET', which
@@ -1385,7 +1372,7 @@ names. Notice how simple it is to construct menus of arbitrary depth:
}
}
-The disadvantage of this approach is that our server is slow and can
+ The disadvantage of this approach is that our server is slow and can
handle only one request at a time. Its main advantage, however, is that
the server consists of just one `gawk' program. No need for installing
an `httpd', and no need for static separate HTML files, CGI scripts, or
@@ -1393,16 +1380,16 @@ an `httpd', and no need for static separate HTML files, CGI scripts, or
started on the same host that runs your browser. Then let your browser
point to `http://localhost:8080'.
-It is also possible to include images into the HTML pages. Most
+ It is also possible to include images into the HTML pages. Most
browsers support the not very well-known `.xbm' format, which may
contain only monochrome pictures but is an ASCII format. Binary images
are possible but not so easy to handle. Another way of including images
is to generate them with a tool such as GNUPlot, by calling the tool
with the `system' function or through a pipe.
----------- Footnotes ----------
+ ---------- Footnotes ----------
-(1) As defined in RFC 2068.
+ (1) As defined in RFC 2068.

File: gawkinet.info, Node: CGI Lib, Prev: Interacting Service, Up: Interacting Service
@@ -1415,7 +1402,7 @@ File: gawkinet.info, Node: CGI Lib, Prev: Interacting Service, Up: Interactin
Phil Smith III,
`http://www.netfunny.com/rhf/jokes/99/Mar/http.html'
-In *Note A Web Service with Interaction: Interacting Service, we saw
+ In *note A Web Service with Interaction: Interacting Service, we saw
the function `CGI_setup' as part of the web server "core logic"
framework. The code presented there handles almost everything necessary
for CGI requests. One thing it doesn't do is handle encoded characters
@@ -1516,11 +1503,11 @@ is the code:
MENU[i] = _CGI_decode(MENU[i])
}
-This isolates details in a single function, `CGI_setup'. Decoding of
-encoded characters is pushed off to a helper function, `_CGI_decode'.
-The use of the leading underscore (`_') in the function name is
-intended to indicate that it is an "internal" function, although there
-is nothing to enforce this:
+ This isolates details in a single function, `CGI_setup'. Decoding
+of encoded characters is pushed off to a helper function,
+`_CGI_decode'. The use of the leading underscore (`_') in the function
+name is intended to indicate that it is an "internal" function,
+although there is nothing to enforce this:
function _CGI_decode(str, hexdigs, i, pre, code1, code2,
val, result)
@@ -1550,7 +1537,7 @@ is nothing to enforce this:
return result
}
-This works by splitting the string apart around an encoded character.
+ This works by splitting the string apart around an encoded character.
The two digits are converted to lowercase characters and looked up in a
string of hex digits. Note that `0' is not in the string on purpose;
`index' returns zero when it's not found, automatically giving the
@@ -1572,7 +1559,7 @@ above functions:
printf "GETARG[\"%s\"] = %s\n", i, GETARG[i]
}
-And this is the result when we run it:
+ And this is the result when we run it:
$ gawk -f testserv.awk
-| MENU["4"] = www.gnu.org
@@ -1603,11 +1590,11 @@ In this node, we finally extend the core to a real application. No one
would actually write a commercial web server in `gawk', but it is
instructive to see that it is feasible in principle.
-The application is ELIZA, the famous program by Joseph Weizenbaum that
-mimics the behavior of a professional psychotherapist when talking to
-you. Weizenbaum would certainly object to this description, but this
-is part of the legend around ELIZA. Take the site-independent core
-logic and append the following code:
+ The application is ELIZA, the famous program by Joseph Weizenbaum
+that mimics the behavior of a professional psychotherapist when talking
+to you. Weizenbaum would certainly object to this description, but
+this is part of the legend around ELIZA. Take the site-independent
+core logic and append the following code:
function SetUpServer() {
SetUpEliza()
@@ -1631,24 +1618,24 @@ logic and append the following code:
TopFooter = "</BODY></HTML>"
}
-`SetUpServer' is similar to the previous example, except for calling
+ `SetUpServer' is similar to the previous example, except for calling
another function, `SetUpEliza'. This approach can be used to implement
other kinds of servers. The only changes needed to do so are hidden in
the functions `SetUpServer' and `HandleGET'. Perhaps it might be
necessary to implement other HTTP methods. The `igawk' program that
comes with `gawk' may be useful for this process.
-When extending this example to a complete application, the first thing
-to do is to implement the function `SetUpServer' to initialize the HTML
-pages and some variables. These initializations determine the way your
-HTML pages look (colors, titles, menu items, etc.).
+ When extending this example to a complete application, the first
+thing to do is to implement the function `SetUpServer' to initialize
+the HTML pages and some variables. These initializations determine the
+way your HTML pages look (colors, titles, menu items, etc.).
-The function `HandleGET' is a nested case selection that decides which
-page the user wants to see next. Each nesting level refers to a menu
-level of the GUI. Each case implements a certain action of the menu. On
-the deepest level of case selection, the handler essentially knows what
-the user wants and stores the answer into the variable that holds the
-HTML page contents:
+ The function `HandleGET' is a nested case selection that decides
+which page the user wants to see next. Each nesting level refers to a
+menu level of the GUI. Each case implements a certain action of the
+menu. On the deepest level of case selection, the handler essentially
+knows what the user wants and stores the answer into the variable that
+holds the HTML page contents:
function HandleGET() {
# A real HTTP server would treat some parts of the URI as a file name.
@@ -1679,7 +1666,7 @@ HTML page contents:
}
}
-Now we are down to the heart of ELIZA, so you can see how it works.
+ Now we are down to the heart of ELIZA, so you can see how it works.
Initially the user does not say anything; then ELIZA resets its money
counter and asks the user to tell what comes to mind open heartedly.
The subsequent answers are converted to uppercase characters and stored
@@ -1732,7 +1719,7 @@ possible answers:
return answer
}
-In the long but simple function `SetUpEliza', you can see tables for
+ In the long but simple function `SetUpEliza', you can see tables for
conjugation, keywords, and answers.(1) The associative array `k'
contains indices into the array of answers `r'. To choose an answer,
ELIZA just picks an index randomly:
@@ -1771,16 +1758,16 @@ ELIZA just picks an index randomly:
}
-Some interesting remarks and details (including the original source code
-of ELIZA) are found on Mark Humphrys' home page. Yahoo! also has a
-page with a collection of ELIZA-like programs. Many of them are written
-in Java, some of them disclosing the Java source code, and a few even
-explain how to modify the Java source code.
+ Some interesting remarks and details (including the original source
+code of ELIZA) are found on Mark Humphrys' home page. Yahoo! also has
+a page with a collection of ELIZA-like programs. Many of them are
+written in Java, some of them disclosing the Java source code, and a
+few even explain how to modify the Java source code.
----------- Footnotes ----------
+ ---------- Footnotes ----------
-(1) The version shown here is abbreviated. The full version comes with
-the `gawk' distribution.
+ (1) The version shown here is abbreviated. The full version comes
+with the `gawk' distribution.

File: gawkinet.info, Node: Caveats, Next: Challenges, Prev: Simple Server, Up: Using Networking
@@ -1800,13 +1787,14 @@ application works or not sometimes depends on the following:
* The state of the party at the other end
-The most difficult problems for a beginner arise from the hidden states
-of the underlying network. After closing a TCP connection, it's often
-necessary to wait a short while before reopening the connection. Even
-more difficult is the establishment of a connection that previously
-ended with a "broken pipe." Those connections have to "time out" for a
-minute or so before they can reopen. Check this with the command
-`netstat -a', which provides a list of still "active" connections.
+ The most difficult problems for a beginner arise from the hidden
+states of the underlying network. After closing a TCP connection, it's
+often necessary to wait a short while before reopening the connection.
+Even more difficult is the establishment of a connection that
+previously ended with a "broken pipe." Those connections have to "time
+out" for a minute or so before they can reopen. Check this with the
+command `netstat -a', which provides a list of still "active"
+connections.

File: gawkinet.info, Node: Challenges, Prev: Caveats, Up: Using Networking
@@ -1867,16 +1855,16 @@ program of 1997:
JUDGE02[10:49:01]I would enjoy all aspects of life no matter what my gender.
PROGRAM[10:49:02]Do you think of yourself as being attractive?
-This program insists on always speaking about the same story around Bill
-Clinton. You see, even a program with a rather narrow mind can behave so
-much like a human being that it can win this prize. It is quite common
-to let these programs talk to each other via network connections. But
-during the competition itself, the program and its computer have to be
-present at the place the competition is held. We all would love to see
-a `gawk' program win in such an event. Maybe it is up to you to
-accomplish this?
+ This program insists on always speaking about the same story around
+Bill Clinton. You see, even a program with a rather narrow mind can
+behave so much like a human being that it can win this prize. It is
+quite common to let these programs talk to each other via network
+connections. But during the competition itself, the program and its
+computer have to be present at the place the competition is held. We
+all would love to see a `gawk' program win in such an event. Maybe it
+is up to you to accomplish this?
-Some other ideas for useful networked applications:
+ Some other ideas for useful networked applications:
* Read the file `doc/awkforai.txt' in the `gawk' distribution. It
was written by Ronald P. Loui (Associate Professor of Computer
Science, at Washington University in St. Louis,
@@ -1965,26 +1953,26 @@ networking world, show new techniques that broaden the scope of
problems that can be solved with `gawk', and explore leading edge
technology that may shape the future of networking.
-We often refer to the site-independent core of the server that we built
-in *Note A Simple Web Server: Simple Server. When building new and
-nontrivial servers, we always copy this building block and append new
-instances of the two functions `SetUpServer' and `HandleGET'.
-
-This makes a lot of sense, since this scheme of event-driven execution
-provides `gawk' with an interface to the most widely accepted standard
-for GUIs: the web browser. Now, `gawk' can rival even Tcl/Tk.
-
-Tcl and `gawk' have much in common. Both are simple scripting languages
-that allow us to quickly solve problems with short programs. But Tcl
-has Tk on top of it, and `gawk' had nothing comparable up to now. While
-Tcl needs a large and ever-changing library (Tk, which was bound to the
-X Window System until recently), `gawk' needs just the networking
-interface and some kind of browser on the client's side. Besides better
-portability, the most important advantage of this approach (embracing
-well-established standards such HTTP and HTML) is that _we do not need
-to change the language_. We let others do the work of fighting over
-protocols and standards. We can use HTML, JavaScript, VRML, or
-whatever else comes along to do our work.
+ We often refer to the site-independent core of the server that we
+built in *note A Simple Web Server: Simple Server. When building new
+and nontrivial servers, we always copy this building block and append
+new instances of the two functions `SetUpServer' and `HandleGET'.
+
+ This makes a lot of sense, since this scheme of event-driven
+execution provides `gawk' with an interface to the most widely accepted
+standard for GUIs: the web browser. Now, `gawk' can rival even Tcl/Tk.
+
+ Tcl and `gawk' have much in common. Both are simple scripting
+languages that allow us to quickly solve problems with short programs.
+But Tcl has Tk on top of it, and `gawk' had nothing comparable up to
+now. While Tcl needs a large and ever-changing library (Tk, which was
+bound to the X Window System until recently), `gawk' needs just the
+networking interface and some kind of browser on the client's side.
+Besides better portability, the most important advantage of this
+approach (embracing well-established standards such HTTP and HTML) is
+that _we do not need to change the language_. We let others do the work
+of fighting over protocols and standards. We can use HTML, JavaScript,
+VRML, or whatever else comes along to do our work.
* Menu:
@@ -2005,11 +1993,11 @@ File: gawkinet.info, Node: PANIC, Next: GETURL, Prev: Some Applications and T
3.1 PANIC: An Emergency Web Server
==================================
-At first glance, the `"Hello, world"' example in *Note A Primitive Web
+At first glance, the `"Hello, world"' example in *note A Primitive Web
Service: Primitive Service, seems useless. By adding just a few lines,
we can turn it into something useful.
-The PANIC program tells everyone who connects that the local site is
+ The PANIC program tells everyone who connects that the local site is
not working. When a web server breaks down, it makes a difference if
customers get a strange "network unreachable" message, or a short
message telling them that the server has a problem. In such an
@@ -2017,10 +2005,10 @@ emergency, the hard disk and everything on it (including the regular
web service) may be unavailable. Rebooting the web server off a
diskette makes sense in this setting.
-To use the PANIC program as an emergency web server, all you need are
-the `gawk' executable and the program below on a diskette. By default,
-it connects to port 8080. A different value may be supplied on the
-command line:
+ To use the PANIC program as an emergency web server, all you need
+are the `gawk' executable and the program below on a diskette. By
+default, it connects to port 8080. A different value may be supplied on
+the command line:
BEGIN {
RS = ORS = "\r\n"
@@ -2058,14 +2046,14 @@ straightforward to write on top of GETURL. On the Internet, you can find
several programs of the same name that do the same job. They are usually
much more complex internally and at least 10 times longer.
-At first, GETURL checks if it was called with exactly one web address.
-Then, it checks if the user chose to use a special proxy server whose
-name is handed over in a variable. By default, it is assumed that the
-local machine serves as proxy. GETURL uses the `GET' method by default
-to access the web page. By handing over the name of a different method
-(such as `HEAD'), it is possible to choose a different behavior. With
-the `HEAD' method, the user does not receive the body of the page
-content, but does receive the header:
+ At first, GETURL checks if it was called with exactly one web
+address. Then, it checks if the user chose to use a special proxy
+server whose name is handed over in a variable. By default, it is
+assumed that the local machine serves as proxy. GETURL uses the `GET'
+method by default to access the web page. By handing over the name of a
+different method (such as `HEAD'), it is possible to choose a different
+behavior. With the `HEAD' method, the user does not receive the body of
+the page content, but does receive the header:
BEGIN {
if (ARGC != 2) {
@@ -2092,7 +2080,7 @@ content, but does receive the header:
close(HttpService)
}
-This program can be changed as needed, but be careful with the last
+ This program can be changed as needed, but be careful with the last
lines. Make sure transmission of binary data is not corrupted by
additional line breaks. Even as it is now, the byte sequence
`"\r\n\r\n"' would disappear if it were contained in binary data. Don't
@@ -2123,7 +2111,7 @@ up:
* HTTP connections with HTML GUIs
-In this node, we look at a solution that uses HTTP connections to
+ In this node, we look at a solution that uses HTTP connections to
control variables of an embedded system that are stored in a file.
Since embedded systems have tight limits on resources like memory, it
is difficult to employ advanced techniques such as SNMP and HTTP
@@ -2132,7 +2120,7 @@ needs just a short script to start working. The following program
stores the variables in a file, and a concurrent process in the
embedded system may read the file. The program uses the
site-independent part of the simple web server that we developed in
-*Note A Web Service with Interaction: Interacting Service. As
+*note A Web Service with Interaction: Interacting Service. As
mentioned there, all we have to do is to write two new procedures
`SetUpServer' and `HandleGET':
@@ -2151,14 +2139,14 @@ mentioned there, all we have to do is to write two new procedures
if (ConfigFile == "") ConfigFile = "config.asc"
}
-The function `SetUpServer' initializes the top level HTML texts as
+ The function `SetUpServer' initializes the top level HTML texts as
usual. It also initializes the name of the file that contains the
configuration parameters and their values. In case the user supplies a
name from the command line, that name is used. The file is expected to
contain one parameter per line, with the name of the parameter in
column one and the value in column two.
-The function `HandleGET' reflects the structure of the menu tree as
+ The function `HandleGET' reflects the structure of the menu tree as
usual. The first menu choice tells the user what this is all about. The
second choice reads the configuration file line by line and stores the
parameters and their values. Notice that the record separator for this
@@ -2209,7 +2197,7 @@ a file:
}
}
-We could also view the configuration file as a database. From this
+ We could also view the configuration file as a database. From this
point of view, the previous program acts like a primitive database
server. Real SQL database systems also make a service available by
providing a TCP port that clients can connect to. But the application
@@ -2229,7 +2217,7 @@ is needed to automatically look at the headers of web pages and tell
which ones have changed. URLCHK does the comparison after using GETURL
with the `HEAD' method to retrieve the header.
-Like GETURL, this program first checks that it is called with exactly
+ Like GETURL, this program first checks that it is called with exactly
one command-line parameter. URLCHK also takes the same command-line
variables `Proxy' and `ProxyPort' as GETURL, because these variables
are handed over to GETURL for each URL that gets checked. The one and
@@ -2246,8 +2234,8 @@ times. Now, we follow this plan:
4. If the most recent and the new length differ, tell the user
-It may seem a bit peculiar to read the URLs from a file together with
-their two most recent lengths, but this approach has several
+ It may seem a bit peculiar to read the URLs from a file together
+with their two most recent lengths, but this approach has several
advantages. You can call the program again and again with the same
file. After running the program, you can regenerate the changed URLs by
extracting those lines that differ in their second and third columns:
@@ -2281,7 +2269,7 @@ extracting those lines that differ in their second and third columns:
close(URLfile)
}
-Another thing that may look strange is the way GETURL is called.
+ Another thing that may look strange is the way GETURL is called.
Before calling GETURL, we have to check if the proxy variables need to
be passed on. If so, we prepare strings that will become part of the
command line later. In `GetHeader', we store these strings together
@@ -2291,7 +2279,7 @@ to form the command that reads the URL's header over the Internet.
GETURL always produces the headers over `/dev/stderr'. That is the
reason why we need the redirection operator to have the header piped in.
-This program is not perfect because it assumes that changing URLs
+ This program is not perfect because it assumes that changing URLs
results in changed lengths, which is not necessarily true. A more
advanced approach is to look at some other header line that holds time
information. But, as always when things get a bit more complicated,
@@ -2315,21 +2303,21 @@ the Bourne shell:
print command
}
-Notice that the regular expression for URLs is rather crude. A precise
-regular expression is much more complex. But this one works rather
-well. One problem is that it is unable to find internal links of an
-HTML document. Another problem is that `ftp', `telnet', `news',
+ Notice that the regular expression for URLs is rather crude. A
+precise regular expression is much more complex. But this one works
+rather well. One problem is that it is unable to find internal links of
+an HTML document. Another problem is that `ftp', `telnet', `news',
`mailto', and other kinds of links are missing in the regular
expression. However, it is straightforward to add them, if doing so is
necessary for other tasks.
-This program reads an HTML file and prints all the HTTP links that it
-finds. It relies on `gawk''s ability to use regular expressions as
+ This program reads an HTML file and prints all the HTTP links that
+it finds. It relies on `gawk''s ability to use regular expressions as
record separators. With `RS' set to a regular expression that matches
links, the second action is executed each time a non-empty link is
found. We can find the matching link itself in `RT'.
-The action could use the `system' function to let another GETURL
+ The action could use the `system' function to let another GETURL
retrieve the page, but here we use a different approach. This simple
program prints shell commands that can be piped into `sh' for
execution. This way it is possible to first extract the links, wrap
@@ -2340,7 +2328,7 @@ retrieve all the pages like this:
gawk -f geturl.awk http://www.suse.de | gawk -f webgrab.awk | sh
-After this, you will find the contents of all referenced documents in
+ After this, you will find the contents of all referenced documents in
files named `doc*.html' even if they do not contain HTML code. The
most annoying thing is that we always have to pass the proxy to GETURL.
If you do not like to see the headers of the web pages appear on the
@@ -2350,13 +2338,13 @@ such as which web server the companies use. Now, it is clear how the
clever marketing people use web robots to determine the market shares
of Microsoft and Netscape in the web server market.
-Port 80 of any web server is like a small hole in a repellent firewall.
-After attaching a browser to port 80, we usually catch a glimpse of the
-bright side of the server (its home page). With a tool like GETURL at
-hand, we are able to discover some of the more concealed or even
-"indecent" services (i.e., lacking conformity to standards of quality).
-It can be exciting to see the fancy CGI scripts that lie there,
-revealing the inner workings of the server, ready to be called:
+ Port 80 of any web server is like a small hole in a repellent
+firewall. After attaching a browser to port 80, we usually catch a
+glimpse of the bright side of the server (its home page). With a tool
+like GETURL at hand, we are able to discover some of the more concealed
+or even "indecent" services (i.e., lacking conformity to standards of
+quality). It can be exciting to see the fancy CGI scripts that lie
+there, revealing the inner workings of the server, ready to be called:
* With a command such as:
@@ -2382,8 +2370,8 @@ revealing the inner workings of the server, ready to be called:
server's log file--possibly containing customer data--or even the
file `/etc/passwd'. (We don't recommend this!)
-*Caution:* Although this may sound funny or simply irrelevant, we are
-talking about severe security holes. Try to explore your own system
+ *Caution:* Although this may sound funny or simply irrelevant, we
+are talking about severe security holes. Try to explore your own system
this way and make sure that none of the above reveals too much
information about your system.
@@ -2399,8 +2387,8 @@ Generating images that reflect some user input and presenting these
dynamically generated images is another. In this node, we use GNUPlot
for generating `.png', `.ps', or `.gif' files.(1)
-The program we develop takes the statistical parameters of two samples
-and computes the t-test statistics. As a result, we get the
+ The program we develop takes the statistical parameters of two
+samples and computes the t-test statistics. As a result, we get the
probabilities that the means and the variances of both samples are the
same. In order to let the user check plausibility, the program presents
an image of the distributions. The statistical computation follows
@@ -2413,8 +2401,8 @@ comparison of means is done as in `tutest', paragraph 14.2, page 613,
and the comparison of variances is done as in `ftest', page 611 in
`Numerical Recipes'.
-As usual, we take the site-independent code for servers and append our
-own functions `SetUpServer' and `HandleGET':
+ As usual, we take the site-independent code for servers and append
+our own functions `SetUpServer' and `HandleGET':
function SetUpServer() {
TopHeader = "<HTML><title>Statistics with GAWK</title>"
@@ -2429,27 +2417,27 @@ own functions `SetUpServer' and `HandleGET':
m1=m2=0; v1=v2=1; n1=n2=10
}
-Here, you see the menu structure that the user sees. Later, we will see
-how the program structure of the `HandleGET' function reflects the menu
-structure. What is missing here is the link for the image we generate.
-In an event-driven environment, request, generation, and delivery of
-images are separated.
-
-Notice the way we initialize the `GnuPlot' command string for the pipe.
-By default, GNUPlot outputs the generated image via standard output, as
-well as the results of `print'(ed) calculations via standard error.
-The redirection causes standard error to be mixed into standard output,
-enabling us to read results of calculations with `getline'. By
+ Here, you see the menu structure that the user sees. Later, we will
+see how the program structure of the `HandleGET' function reflects the
+menu structure. What is missing here is the link for the image we
+generate. In an event-driven environment, request, generation, and
+delivery of images are separated.
+
+ Notice the way we initialize the `GnuPlot' command string for the
+pipe. By default, GNUPlot outputs the generated image via standard
+output, as well as the results of `print'(ed) calculations via standard
+error. The redirection causes standard error to be mixed into standard
+output, enabling us to read results of calculations with `getline'. By
initializing the statistical parameters with some meaningful defaults,
we make sure the user gets an image the first time he uses the program.
-Following is the rather long function `HandleGET', which implements the
-contents of this service by reacting to the different kinds of requests
-from the browser. Before you start playing with this script, make sure
-that your browser supports JavaScript and that it also has this option
-switched on. The script uses a short snippet of JavaScript code for
-delayed opening of a window with an image. A more detailed explanation
-follows:
+ Following is the rather long function `HandleGET', which implements
+the contents of this service by reacting to the different kinds of
+requests from the browser. Before you start playing with this script,
+make sure that your browser supports JavaScript and that it also has
+this option switched on. The script uses a short snippet of JavaScript
+code for delayed opening of a window with an image. A more detailed
+explanation follows:
function HandleGET() {
if(MENU[2] == "AboutServer") {
@@ -2525,27 +2513,27 @@ follows:
}
}
-As usual, we give a short description of the service in the first menu
-choice. The third menu choice shows us that generation and presentation
-of an image are two separate actions. While the latter takes place
-quite instantly in the third menu choice, the former takes place in the
-much longer second choice. Image data passes from the generating action
-to the presenting action via the variable `Image' that contains a
-complete `.png' image, which is otherwise stored in a file. If you
-prefer `.ps' or `.gif' images over the default `.png' images, you may
-select these options by uncommenting the appropriate lines. But
-remember to do so in two places: when telling GNUPlot which kind of
-images to generate, and when transmitting the image at the end of the
-program.
-
-Looking at the end of the program, the way we pass the `Content-type'
-to the browser is a bit unusual. It is appended to the `OK' of the
-first header line to make sure the type information becomes part of the
-header. The other variables that get transmitted across the network are
-made empty, because in this case we do not have an HTML document to
-transmit, but rather raw image data to contain in the body.
-
-Most of the work is done in the second menu choice. It starts with a
+ As usual, we give a short description of the service in the first
+menu choice. The third menu choice shows us that generation and
+presentation of an image are two separate actions. While the latter
+takes place quite instantly in the third menu choice, the former takes
+place in the much longer second choice. Image data passes from the
+generating action to the presenting action via the variable `Image'
+that contains a complete `.png' image, which is otherwise stored in a
+file. If you prefer `.ps' or `.gif' images over the default `.png'
+images, you may select these options by uncommenting the appropriate
+lines. But remember to do so in two places: when telling GNUPlot which
+kind of images to generate, and when transmitting the image at the end
+of the program.
+
+ Looking at the end of the program, the way we pass the
+`Content-type' to the browser is a bit unusual. It is appended to the
+`OK' of the first header line to make sure the type information becomes
+part of the header. The other variables that get transmitted across
+the network are made empty, because in this case we do not have an HTML
+document to transmit, but rather raw image data to contain in the body.
+
+ Most of the work is done in the second menu choice. It starts with a
strange JavaScript code snippet. When first implementing this server,
we used a short `"<IMG SRC=" MyPrefix "/Image>"' here. But then
browsers got smarter and tried to improve on speed by requesting the
@@ -2559,9 +2547,9 @@ solved this problem by telling the browser to open a separate window
for the image, but only after a delay of 1000 milliseconds. By this
time, the server should be ready for serving the next request.
-But there is one more subtlety in the JavaScript code. Each time the
-JavaScript code opens a window for the image, the name of the image is
-appended with a timestamp (`systime'). Why this constant change of
+ But there is one more subtlety in the JavaScript code. Each time
+the JavaScript code opens a window for the image, the name of the image
+is appended with a timestamp (`systime'). Why this constant change of
name for the image? Initially, we always named the image `Image', but
then the Netscape browser noticed the name had _not_ changed since the
previous request and displayed the previous image (caching behavior).
@@ -2571,7 +2559,7 @@ way to circumvent the cache of such overly smart browsers is to change
the name of the image with each request. These three lines of JavaScript
caused us a lot of trouble.
-The rest can be broken down into two phases. At first, we check if
+ The rest can be broken down into two phases. At first, we check if
there are statistical parameters. When the program is first started,
there usually are no parameters because it enters the page coming from
the top menu. Then, we only have to present the user a form that he
@@ -2579,21 +2567,22 @@ can use to change statistical parameters and submit them. Subsequently,
the submission of the form causes the execution of the first phase
because _now_ there _are_ parameters to handle.
-Now that we have parameters, we know there will be an image available.
-Therefore we insert the JavaScript code here to initiate the opening of
-the image in a separate window. Then, we prepare some variables that
-will be passed to GNUPlot for calculation of the probabilities. Prior
-to reading the results, we must temporarily change `RS' because GNUPlot
-separates lines with newlines. After instructing GNUPlot to generate a
-`.png' (or `.ps' or `.gif') image, we initiate the insertion of some
-text, explaining the resulting probabilities. The final `plot' command
-actually generates the image data. This raw binary has to be read in
-carefully without adding, changing, or deleting a single byte. Hence
-the unusual initialization of `Image' and completion with a `while'
-loop.
-
-When using this server, it soon becomes clear that it is far from being
-perfect. It mixes source code of six scripting languages or protocols:
+ Now that we have parameters, we know there will be an image
+available. Therefore we insert the JavaScript code here to initiate
+the opening of the image in a separate window. Then, we prepare some
+variables that will be passed to GNUPlot for calculation of the
+probabilities. Prior to reading the results, we must temporarily change
+`RS' because GNUPlot separates lines with newlines. After instructing
+GNUPlot to generate a `.png' (or `.ps' or `.gif') image, we initiate
+the insertion of some text, explaining the resulting probabilities. The
+final `plot' command actually generates the image data. This raw binary
+has to be read in carefully without adding, changing, or deleting a
+single byte. Hence the unusual initialization of `Image' and completion
+with a `while' loop.
+
+ When using this server, it soon becomes clear that it is far from
+being perfect. It mixes source code of six scripting languages or
+protocols:
* GNU `awk' implements a server for the protocol:
@@ -2607,17 +2596,17 @@ perfect. It mixes source code of six scripting languages or protocols:
* GNUPlot to generate the image to be opened.
-After all this work, the GNUPlot image opens in the JavaScript window
+ After all this work, the GNUPlot image opens in the JavaScript window
where it can be viewed by the user.
-It is probably better not to mix up so many different languages. The
-result is not very readable. Furthermore, the statistical part of the
-server does not take care of invalid input. Among others, using
+ It is probably better not to mix up so many different languages.
+The result is not very readable. Furthermore, the statistical part of
+the server does not take care of invalid input. Among others, using
negative variances will cause invalid results.
----------- Footnotes ----------
+ ---------- Footnotes ----------
-(1) Due to licensing problems, the default installation of GNUPlot
+ (1) Due to licensing problems, the default installation of GNUPlot
disables the generation of `.gif' files. If your installed version
does not accept `set term gif', just download and install the most
recent version of GNUPlot and the GD library
@@ -2634,20 +2623,20 @@ File: gawkinet.info, Node: MAZE, Next: MOBAGWHO, Prev: STATIST, Up: Some App
In the long run, every program becomes rococo, and then rubble.
Alan Perlis
-By now, we know how to present arbitrary `Content-type's to a browser.
-In this node, our server will present a 3D world to our browser. The
-3D world is described in a scene description language (VRML, Virtual
-Reality Modeling Language) that allows us to travel through a
-perspective view of a 2D maze with our browser. Browsers with a VRML
-plugin enable exploration of this technology. We could do one of those
-boring `Hello world' examples here, that are usually presented when
-introducing novices to VRML. If you have never written any VRML code,
-have a look at the VRML FAQ. Presenting a static VRML scene is a bit
-trivial; in order to expose `gawk''s new capabilities, we will present
-a dynamically generated VRML scene. The function `SetUpServer' is very
-simple because it only sets the default HTML page and initializes the
-random number generator. As usual, the surrounding server lets you
-browse the maze.
+ By now, we know how to present arbitrary `Content-type's to a
+browser. In this node, our server will present a 3D world to our
+browser. The 3D world is described in a scene description language
+(VRML, Virtual Reality Modeling Language) that allows us to travel
+through a perspective view of a 2D maze with our browser. Browsers with
+a VRML plugin enable exploration of this technology. We could do one of
+those boring `Hello world' examples here, that are usually presented
+when introducing novices to VRML. If you have never written any VRML
+code, have a look at the VRML FAQ. Presenting a static VRML scene is a
+bit trivial; in order to expose `gawk''s new capabilities, we will
+present a dynamically generated VRML scene. The function `SetUpServer'
+is very simple because it only sets the default HTML page and
+initializes the random number generator. As usual, the surrounding
+server lets you browse the maze.
function SetUpServer() {
TopHeader = "<HTML><title>Walk through a maze</title>"
@@ -2661,8 +2650,8 @@ browse the maze.
srand()
}
-The function `HandleGET' is a bit longer because it first computes the
-maze and afterwards generates the VRML code that is sent across the
+ The function `HandleGET' is a bit longer because it first computes
+the maze and afterwards generates the VRML code that is sent across the
network. As shown in the STATIST example (*note STATIST::), we set the
type of the content to VRML and then store the VRML representation of
the maze as the page content. We assume that the maze is stored in a 2D
@@ -2718,24 +2707,24 @@ code for each wall field.
}
}
-Finally, we have a look at `MakeMaze', the function that generates the
-`Maze' array. When entered, this function assumes that the array has
-been initialized so that each element represents a wall element and the
-maze is initially full of wall elements. Only the entrance and the exit
-of the maze should have been left free. The parameters of the function
-tell us which element must be marked as not being a wall. After this,
-we take a look at the four neighbouring elements and remember which we
-have already treated. Of all the neighbouring elements, we take one at
-random and walk in that direction. Therefore, the wall element in that
-direction has to be removed and then, we call the function recursively
-for that element. The maze is only completed if we iterate the above
-procedure for _all_ neighbouring elements (in random order) and for our
-present element by recursively calling the function for the present
-element. This last iteration could have been done in a loop, but it is
-done much simpler recursively.
-
-Notice that elements with coordinates that are both odd are assumed to
-be on our way through the maze and the generating process cannot
+ Finally, we have a look at `MakeMaze', the function that generates
+the `Maze' array. When entered, this function assumes that the array
+has been initialized so that each element represents a wall element and
+the maze is initially full of wall elements. Only the entrance and the
+exit of the maze should have been left free. The parameters of the
+function tell us which element must be marked as not being a wall.
+After this, we take a look at the four neighbouring elements and
+remember which we have already treated. Of all the neighbouring
+elements, we take one at random and walk in that direction. Therefore,
+the wall element in that direction has to be removed and then, we call
+the function recursively for that element. The maze is only completed
+if we iterate the above procedure for _all_ neighbouring elements (in
+random order) and for our present element by recursively calling the
+function for the present element. This last iteration could have been
+done in a loop, but it is done much simpler recursively.
+
+ Notice that elements with coordinates that are both odd are assumed
+to be on our way through the maze and the generating process cannot
terminate as long as there is such an element not being `delete'd. All
other elements are potentially part of the wall.
@@ -2769,8 +2758,8 @@ File: gawkinet.info, Node: MOBAGWHO, Next: STOXPRED, Prev: MAZE, Up: Some Ap
deficiencies.
C. A. R. Hoare
-A "mobile agent" is a program that can be dispatched from a computer and
-transported to a remote server for execution. This is called
+ A "mobile agent" is a program that can be dispatched from a computer
+and transported to a remote server for execution. This is called
"migration", which means that a process on another system is started
that is independent from its originator. Ideally, it wanders through a
network while working for its creator or owner. In places like the UMBC
@@ -2781,10 +2770,10 @@ between users and the networking world. For an unbiased view at this
technology, see the remarkable paper `Mobile Agents: Are they a good
idea?'.(1)
-When trying to migrate a process from one system to another, a server
-process is needed on the receiving side. Depending on the kind of
-server process, several ways of implementation come to mind. How the
-process is implemented depends upon the kind of server process:
+ When trying to migrate a process from one system to another, a
+server process is needed on the receiving side. Depending on the kind
+of server process, several ways of implementation come to mind. How
+the process is implemented depends upon the kind of server process:
* HTTP can be used as the protocol for delivery of the migrating
process. In this case, we use a common web server as the receiving
@@ -2809,12 +2798,12 @@ process is implemented depends upon the kind of server process:
server process with a dedicated protocol specialized for receiving
mobile agents.
-Our agent example abuses a common web server as a migration tool. So,
-it needs a universal CGI script on the receiving side (the web server).
-The receiving script is activated with a `POST' request when placed
-into a location like `/httpd/cgi-bin/PostAgent.sh'. Make sure that the
-server system uses a version of `gawk' that supports network access
-(Version 3.1 or later; verify with `gawk --version').
+ Our agent example abuses a common web server as a migration tool.
+So, it needs a universal CGI script on the receiving side (the web
+server). The receiving script is activated with a `POST' request when
+placed into a location like `/httpd/cgi-bin/PostAgent.sh'. Make sure
+that the server system uses a version of `gawk' that supports network
+access (Version 3.1 or later; verify with `gawk --version').
#!/bin/sh
MobAg=/tmp/MobileAgent.$$
@@ -2826,7 +2815,7 @@ server system uses a version of `gawk' that supports network access
gawk 'BEGIN { print "\r\nAgent started" }'
rm $MobAg # delete script file of agent
-By making its process id (`$$') part of the unique file name, the
+ By making its process id (`$$') part of the unique file name, the
script avoids conflicts between concurrent instances of the script.
First, all lines from standard input (the mobile agent's source code)
are copied into this unique file. Then, the agent is started as a
@@ -2855,17 +2844,17 @@ Independence
way. By reporting `Agent started', it waves "Goodbye" to its
origin. The originator may choose to terminate or not.
-The originating agent itself is started just like any other command-line
-script, and reports the results on standard output. By letting the name
-of the original host migrate with the agent, the agent that migrates to
-a host far away from its origin can report the result back home.
-Having arrived at the end of the journey, the agent establishes a
-connection and reports the results. This is the reason for determining
-the name of the host with `uname -n' and storing it in `MyOrigin' for
-later use. We may also set variables with the `-v' option from the
-command line. This interactivity is only of importance in the context
-of starting a mobile agent; therefore this `BEGIN' pattern and its
-action do not take part in migration:
+ The originating agent itself is started just like any other
+command-line script, and reports the results on standard output. By
+letting the name of the original host migrate with the agent, the agent
+that migrates to a host far away from its origin can report the result
+back home. Having arrived at the end of the journey, the agent
+establishes a connection and reports the results. This is the reason
+for determining the name of the host with `uname -n' and storing it in
+`MyOrigin' for later use. We may also set variables with the `-v'
+option from the command line. This interactivity is only of importance
+in the context of starting a mobile agent; therefore this `BEGIN'
+pattern and its action do not take part in migration:
BEGIN {
if (ARGC != 2) {
@@ -2883,7 +2872,7 @@ action do not take part in migration:
}
}
-Since `gawk' cannot manipulate and transmit parts of the program
+ Since `gawk' cannot manipulate and transmit parts of the program
directly, the source code is read and stored in strings. Therefore,
the program scans itself for the beginning and the ending of functions.
Each line in between is appended to the code string until the end of
@@ -2901,7 +2890,7 @@ guarantee that the order of the functions is preserved during migration:
{ FUNC = "" }
#EndOfMySelf
-The web server code in *Note A Web Service with Interaction:
+ The web server code in *note A Web Service with Interaction:
Interacting Service, was first developed as a site-independent core.
Likewise, the `gawk'-based mobile agent starts with an
agent-independent core, to which can be appended application-dependent
@@ -2927,19 +2916,19 @@ needed for the mobile agent:
close(HttpService)
}
-The `migrate' function prepares the aforementioned strings containing
-the program code and transmits them to a server. A consequence of this
-modular approach is that the `migrate' function takes some parameters
-that aren't needed in this application, but that will be in future
-ones. Its mandatory parameter `Destination' holds the name (or IP
-address) of the server that the agent wants as a host for its code. The
-optional parameter `MobCode' may contain some `gawk' code that is
-inserted during migration in front of all other code. The optional
-parameter `Label' may contain a string that tells the agent what to do
-in program execution after arrival at its new home site. One of the
-serious obstacles in implementing a framework for mobile agents is that
-it does not suffice to migrate the code. It is also necessary to
-migrate the state of execution of the agent. In contrast to `Agent
+ The `migrate' function prepares the aforementioned strings
+containing the program code and transmits them to a server. A
+consequence of this modular approach is that the `migrate' function
+takes some parameters that aren't needed in this application, but that
+will be in future ones. Its mandatory parameter `Destination' holds the
+name (or IP address) of the server that the agent wants as a host for
+its code. The optional parameter `MobCode' may contain some `gawk' code
+that is inserted during migration in front of all other code. The
+optional parameter `Label' may contain a string that tells the agent
+what to do in program execution after arrival at its new home site. One
+of the serious obstacles in implementing a framework for mobile agents
+is that it does not suffice to migrate the code. It is also necessary
+to migrate the state of execution of the agent. In contrast to `Agent
Tcl', this program does not try to migrate the complete set of
variables. The following conventions are used:
@@ -2953,7 +2942,7 @@ variables. The following conventions are used:
takes part in migration has to be an element of this array.
`migrate' also takes care of this.
-Now it's clear what happens to the `Label' parameter of the function
+ Now it's clear what happens to the `Label' parameter of the function
`migrate'. It is copied into `MOBVAR["Label"]' and travels alongside
the other data. Since travelling takes place via HTTP, records must be
separated with `"\r\n"' in `RS' and `ORS' as usual. The code assembly
@@ -2969,7 +2958,7 @@ for migration takes place in three steps:
any reply over the network, it is read completely and echoed to
standard output to avoid irritating the server.
-The application-independent framework is now almost complete. What
+ The application-independent framework is now almost complete. What
follows is the `END' pattern that is executed when the mobile agent has
finished reading its own code. First, it checks whether it is already
running on a remote host or not. In case initialization has not yet
@@ -2984,10 +2973,10 @@ starts `MyJob':
MyJob() # so we do our job
}
-All that's left to extend the framework into a complete application is
-to write two application-specific functions: `MyInit' and `MyJob'. Keep
-in mind that the former is executed once on the originating host, while
-the latter is executed after each migration:
+ All that's left to extend the framework into a complete application
+is to write two application-specific functions: `MyInit' and `MyJob'.
+Keep in mind that the former is executed once on the originating host,
+while the latter is executed after each migration:
function MyInit() {
MOBVAR["MyOrigin"] = MyOrigin
@@ -2999,7 +2988,7 @@ the latter is executed after each migration:
close("/inet/tcp/8080/0/0")
}
-As mentioned earlier, this agent takes the name of its origin
+ As mentioned earlier, this agent takes the name of its origin
(`MyOrigin') with it. Then, it takes the name of its first destination
and goes there for further work. Notice that this name has the port
number of the web server appended to the name of the server, because
@@ -3024,10 +3013,10 @@ function runs on the remote host:
}
}
-After migrating, the first thing to do in `MyJob' is to delete the name
-of the current host from the list of hosts to visit. Now, it is time to
-start the real work by appending the host's name to the result string,
-and reading line by line who is logged in on this host. A very
+ After migrating, the first thing to do in `MyJob' is to delete the
+name of the current host from the list of hosts to visit. Now, it is
+time to start the real work by appending the host's name to the result
+string, and reading line by line who is logged in on this host. A very
annoying circumstance is the fact that the elements of `MOBVAR' cannot
hold the newline character (`"\n"'). If they did, migration of this
string did not work because the string didn't obey the syntax rule for
@@ -3038,9 +3027,9 @@ the `SUBSEP's with a newline character in the resulting string, and
report it to the originating host, whose name is stored in
`MOBVAR["MyOrigin"]'.
----------- Footnotes ----------
+ ---------- Footnotes ----------
-(1) `http://www.research.ibm.com/massive/mobag.ps'
+ (1) `http://www.research.ibm.com/massive/mobag.ps'

File: gawkinet.info, Node: STOXPRED, Next: PROTBASE, Prev: MOBAGWHO, Up: Some Applications and Techniques
@@ -3065,7 +3054,7 @@ File: gawkinet.info, Node: STOXPRED, Next: PROTBASE, Prev: MOBAGWHO, Up: Som
green pieces of paper that were unhappy.
Douglas Adams, `The Hitch Hiker's Guide to the Galaxy'
-Valuable services on the Internet are usually _not_ implemented as
+ Valuable services on the Internet are usually _not_ implemented as
mobile agents. There are much simpler ways of implementing services.
All Unix systems provide, for example, the `cron' service. Unix system
users can write a list of tasks to be done each day, each week, twice a
@@ -3076,17 +3065,17 @@ For example, to distribute a newsletter on a daily basis this way, use
# run at 8 am on weekdays, distribute the newsletter
0 8 * * 1-5 $HOME/bin/daily.job >> $HOME/log/newsletter 2>&1
-The script first looks for interesting information on the Internet,
+ The script first looks for interesting information on the Internet,
assembles it in a nice form and sends the results via email to the
customers.
-The following is an example of a primitive newsletter on stock market
-prediction. It is a report which first tries to predict the change of
-each share in the Dow Jones Industrial Index for the particular day.
-Then it mentions some especially promising shares as well as some
-shares which look remarkably bad on that day. The report ends with the
-usual disclaimer which tells every child _not_ to try this at home and
-hurt anybody.
+ The following is an example of a primitive newsletter on stock
+market prediction. It is a report which first tries to predict the
+change of each share in the Dow Jones Industrial Index for the
+particular day. Then it mentions some especially promising shares as
+well as some shares which look remarkably bad on that day. The report
+ends with the usual disclaimer which tells every child _not_ to try
+this at home and hurt anybody.
Good morning Uncle Scrooge,
@@ -3121,7 +3110,7 @@ hurt anybody.
DD http://biz.yahoo.com/n/d/dd.html
...
-The script as a whole is rather long. In order to ease the pain of
+ The script as a whole is rather long. In order to ease the pain of
studying other people's source code, we have broken the script up into
meaningful parts which are invoked one after the other. The basic
structure of the script is as follows:
@@ -3135,7 +3124,7 @@ structure of the script is as follows:
SendMail()
}
-The earlier parts store data into variables and arrays which are
+ The earlier parts store data into variables and arrays which are
subsequently used by later parts of the script. The `Init' function
first checks if the script is invoked correctly (without any
parameters). If not, it informs the user of the correct usage. What
@@ -3143,10 +3132,10 @@ follows are preparations for the retrieval of the historical quote
data. The names of the 30 stock shares are stored in an array `name'
along with the current date in `day', `month', and `year'.
-All users who are separated from the Internet by a firewall and have to
-direct their Internet accesses to a proxy must supply the name of the
-proxy to this script with the `-v Proxy=NAME' option. For most users,
-the default proxy and port number should suffice.
+ All users who are separated from the Internet by a firewall and have
+to direct their Internet accesses to a proxy must supply the name of
+the proxy to this script with the `-v Proxy=NAME' option. For most
+users, the default proxy and port number should suffice.
function Init() {
if (ARGC != 1) {
@@ -3170,7 +3159,7 @@ the default proxy and port number should suffice.
YahooData = "/inet/tcp/0/" Proxy "/" ProxyPort
}
-There are two really interesting parts in the script. One is the
+ There are two really interesting parts in the script. One is the
function which reads the historical stock quotes from an Internet
server. The other is the one that does the actual prediction. In the
following function we see how the quotes are read from the Yahoo
@@ -3182,7 +3171,7 @@ server. The data which comes from the server is in CSV format
6-Oct-00,23.8125,24.9375,21.5625,22,10701100
5-Oct-00,24.4375,24.625,23.125,23.50,5810300
-Lines contain values of the same time instant, whereas columns are
+ Lines contain values of the same time instant, whereas columns are
separated by commas and contain the kind of data that is described in
the header (first) line. At first, `gawk' is instructed to separate
columns by commas (`FS = ","'). In the loop that follows, a connection
@@ -3194,7 +3183,7 @@ ending date are chosen to be exactly the same, but one year apart in
the past. All the action is initiated within the `printf' command which
transmits the request for data to the Yahoo server.
-In the inner loop, the server's data is first read and then scanned
+ In the inner loop, the server's data is first read and then scanned
line by line. Only lines which have six columns and the name of a month
in the first column contain relevant data. This data is stored in the
two-dimensional array `quote'; one dimension being time, the other
@@ -3223,9 +3212,9 @@ because we need them later.
FS = " "
}
-Now that we _have_ the data, it can be checked once again to make sure
-that no individual stock is missing or invalid, and that all the stock
-quotes are aligned correctly. Furthermore, we renumber the time
+ Now that we _have_ the data, it can be checked once again to make
+sure that no individual stock is missing or invalid, and that all the
+stock quotes are aligned correctly. Furthermore, we renumber the time
instances. The most recent day gets day number 1 and all other days get
consecutive numbers. All quotes are rounded toward the nearest whole
number in US Dollars.
@@ -3246,16 +3235,16 @@ number in US Dollars.
delete days
}
-Now we have arrived at the second really interesting part of the whole
-affair. What we present here is a very primitive prediction algorithm:
-_If a stock fell yesterday, assume it will also fall today; if it rose
-yesterday, assume it will rise today_. (Feel free to replace this
-algorithm with a smarter one.) If a stock changed in the same direction
-on two consecutive days, this is an indication which should be
-highlighted. Two-day advances are stored in `hot' and two-day declines
-in `avoid'.
+ Now we have arrived at the second really interesting part of the
+whole affair. What we present here is a very primitive prediction
+algorithm: _If a stock fell yesterday, assume it will also fall today;
+if it rose yesterday, assume it will rise today_. (Feel free to
+replace this algorithm with a smarter one.) If a stock changed in the
+same direction on two consecutive days, this is an indication which
+should be highlighted. Two-day advances are stored in `hot' and
+two-day declines in `avoid'.
-The rest of the function is a sanity check. It counts the number of
+ The rest of the function is a sanity check. It counts the number of
correct predictions in relation to the total number of predictions one
could have made in the year before.
@@ -3292,9 +3281,10 @@ could have made in the year before.
}
}
-At this point the hard work has been done: the array `predict' contains
-the predictions for all the ticker symbols. It is up to the function
-`Report' to find some nice words to introduce the desired information.
+ At this point the hard work has been done: the array `predict'
+contains the predictions for all the ticker symbols. It is up to the
+function `Report' to find some nice words to introduce the desired
+information.
function Report() {
# Generate report
@@ -3330,10 +3320,10 @@ the predictions for all the ticker symbols. It is up to the function
report = report "you should visit a doctor who can treat your ailment."
}
-The function `SendMail' goes through the list of customers and opens a
-pipe to the `mail' command for each of them. Each one receives an email
-message with a proper subject heading and is addressed with his full
-name.
+ The function `SendMail' goes through the list of customers and opens
+a pipe to the `mail' command for each of them. Each one receives an
+email message with a proper subject heading and is addressed with his
+full name.
function SendMail() {
# send report to customers
@@ -3352,7 +3342,7 @@ name.
}
}
-Be patient when running the script by hand. Retrieving the data for
+ Be patient when running the script by hand. Retrieving the data for
all the ticker symbols and sending the emails may take several minutes
to complete, depending upon network traffic and the speed of the
available Internet link. The quality of the prediction algorithm is
@@ -3369,20 +3359,20 @@ File: gawkinet.info, Node: PROTBASE, Prev: STOXPRED, Up: Some Applications an
Hoare's Law of Large Problems: Inside every large problem is a
small problem struggling to get out.
-Yahoo's database of stock market data is just one among the many large
-databases on the Internet. Another one is located at NCBI (National
-Center for Biotechnology Information). Established in 1988 as a
-national resource for molecular biology information, NCBI creates
+ Yahoo's database of stock market data is just one among the many
+large databases on the Internet. Another one is located at NCBI
+(National Center for Biotechnology Information). Established in 1988 as
+a national resource for molecular biology information, NCBI creates
public databases, conducts research in computational biology, develops
software tools for analyzing genome data, and disseminates biomedical
information. In this section, we look at one of NCBI's public services,
which is called BLAST (Basic Local Alignment Search Tool).
-You probably know that the information necessary for reproducing living
-cells is encoded in the genetic material of the cells. The genetic
-material is a very long chain of four base nucleotides. It is the order
-of appearance (the sequence) of nucleotides which contains the
-information about the substance to be produced. Scientists in
+ You probably know that the information necessary for reproducing
+living cells is encoded in the genetic material of the cells. The
+genetic material is a very long chain of four base nucleotides. It is
+the order of appearance (the sequence) of nucleotides which contains
+the information about the substance to be produced. Scientists in
biotechnology often find a specific fragment, determine the nucleotide
sequence, and need to know where the sequence at hand comes from. This
is where the large databases enter the game. At NCBI, databases store
@@ -3421,14 +3411,14 @@ services:
you can send a message consisting of the word "HELP" to the same
address, <blast@ncbi.nlm.nih.gov>.
-Our starting point is the demonstration client mentioned in the first
-option. The `README' file that comes along with the client explains
-the whole process in a nutshell. In the rest of this section, we first
-show what such requests look like. Then we show how to use `gawk' to
-implement a client in about 10 lines of code. Finally, we show how to
-interpret the result returned from the service.
+ Our starting point is the demonstration client mentioned in the
+first option. The `README' file that comes along with the client
+explains the whole process in a nutshell. In the rest of this section,
+we first show what such requests look like. Then we show how to use
+`gawk' to implement a client in about 10 lines of code. Finally, we
+show how to interpret the result returned from the service.
-Sequences are expected to be represented in the standard IUB/IUPAC
+ Sequences are expected to be represented in the standard IUB/IUPAC
amino acid and nucleic acid codes, with these exceptions: lower-case
letters are accepted and are mapped into upper-case; a single hyphen or
dash can be used to represent a gap of indeterminate length; and in
@@ -3448,7 +3438,7 @@ residue). The nucleic acid codes supported are:
K --> G T (keto) N --> A G C T (any)
- gap of indeterminate length
-Now you know the alphabet of nucleotide sequences. The last two lines
+ Now you know the alphabet of nucleotide sequences. The last two lines
of the following example query show you such a sequence, which is
obviously made up only of elements of the alphabet just described.
Store this example query into a file named `protbase.request'. You are
@@ -3462,23 +3452,23 @@ now ready to send it to the server with the demonstration client.
tgcttggctgaggagccataggacgagagcttcctggtgaagtgtgtttcttgaaatcat
caccaccatggacagcaaa
-The actual search request begins with the mandatory parameter `PROGRAM'
-in the first column followed by the value `blastn' (the name of the
-program) for searching nucleic acids. The next line contains the
-mandatory search parameter `DATALIB' with the value `month' for the
+ The actual search request begins with the mandatory parameter
+`PROGRAM' in the first column followed by the value `blastn' (the name
+of the program) for searching nucleic acids. The next line contains
+the mandatory search parameter `DATALIB' with the value `month' for the
newest nucleic acid sequences. The third line contains an optional
`EXPECT' parameter and the value desired for it. The fourth line
contains the mandatory `BEGIN' directive, followed by the query
sequence in FASTA/Pearson format. Each line of information must be
less than 80 characters in length.
-The "month" database contains all new or revised sequences released in
-the last 30 days and is useful for searching against new sequences.
+ The "month" database contains all new or revised sequences released
+in the last 30 days and is useful for searching against new sequences.
There are five different blast programs, `blastn' being the one that
compares a nucleotide query sequence against a nucleotide sequence
database.
-The last server directive that must appear in every request is the
+ The last server directive that must appear in every request is the
`BEGIN' directive. The query sequence should immediately follow the
`BEGIN' directive and must appear in FASTA/Pearson format. A sequence
in FASTA/Pearson format begins with a single-line description. The
@@ -3487,13 +3477,13 @@ sequence data that follow it by having a greater-than (`>') symbol in
the first column. For the purposes of the BLAST server, the text of
the description is arbitrary.
-If you prefer to use a client written in `gawk', just store the
+ If you prefer to use a client written in `gawk', just store the
following 10 lines of code into a file named `protbase.awk' and use
this client instead. Invoke it with `gawk -f protbase.awk
protbase.request'. Then wait a minute and watch the result coming in.
In order to replicate the demonstration client's behaviour as closely
as possible, this client does not use a proxy server. We could also
-have extended the client program in *Note Retrieving Web Pages: GETURL,
+have extended the client program in *note Retrieving Web Pages: GETURL,
to implement the client request from `protbase.awk' as a special case.
{ request = request "\n" $0 }
@@ -3508,19 +3498,19 @@ to implement the client request from `protbase.awk' as a special case.
close(BLASTService)
}
-The demonstration client from NCBI is 214 lines long (written in C) and
-it is not immediately obvious what it does. Our client is so short that
-it _is_ obvious what it does. First it loops over all lines of the
+ The demonstration client from NCBI is 214 lines long (written in C)
+and it is not immediately obvious what it does. Our client is so short
+that it _is_ obvious what it does. First it loops over all lines of the
query and stores the whole query into a variable. Then the script
establishes an Internet connection to the NCBI server and transmits the
query by framing it with a proper HTTP request. Finally it receives and
prints the complete result coming from the server.
-Now, let us look at the result. It begins with an HTTP header, which you
-can ignore. Then there are some comments about the query having been
+ Now, let us look at the result. It begins with an HTTP header, which
+you can ignore. Then there are some comments about the query having been
filtered to avoid spuriously high scores. After this, there is a
reference to the paper that describes the software being used for
-searching the data base. After a repitition of the original query's
+searching the data base. After a repetition of the original query's
description we find the list of significant alignments:
Sequences producing significant alignments: (bits) Value
@@ -3533,13 +3523,13 @@ description we find the list of significant alignments:
emb|AL138812.9|AL138812 Homo sapiens chromosome 11 clone RP1-276... 38 0.20
gb|AC073881.3|AC073881 Homo sapiens chromosome 15 clone CTD-2169... 38 0.20
-This means that the query sequence was found in seven human chromosomes.
-But the value 0.20 (20%) means that the probability of an accidental
-match is rather high (20%) in all cases and should be taken into
-account. You may wonder what the first column means. It is a key to
-the specific database in which this occurence was found. The unique
-sequence identifiers reported in the search results can be used as
-sequence retrieval keys via the NCBI server. The syntax of sequence
+ This means that the query sequence was found in seven human
+chromosomes. But the value 0.20 (20%) means that the probability of an
+accidental match is rather high (20%) in all cases and should be taken
+into account. You may wonder what the first column means. It is a key
+to the specific database in which this occurrence was found. The
+unique sequence identifiers reported in the search results can be used
+as sequence retrieval keys via the NCBI server. The syntax of sequence
header lines used by the NCBI BLAST server depends on the database from
which each sequence was obtained. The table below lists the
identifiers for the databases from which the sequences were derived.
@@ -3557,13 +3547,13 @@ identifiers for the databases from which the sequences were derived.
Patents pat|country|number
GenInfo Backbone Id bbs|number
-For example, an identifier might be `gb|AC021182.14|AC021182', where the
-`gb' tag indicates that the identifier refers to a GenBank sequence,
+ For example, an identifier might be `gb|AC021182.14|AC021182', where
+the `gb' tag indicates that the identifier refers to a GenBank sequence,
`AC021182.14' is its GenBank ACCESSION, and `AC021182' is the GenBank
LOCUS. The identifier contains no spaces, so that a space indicates
the end of the identifier.
-Let us continue in the result listing. Each of the seven alignments
+ Let us continue in the result listing. Each of the seven alignments
mentioned above is subsequently described in detail. We will have a
closer look at the first of them.
@@ -3579,20 +3569,20 @@ closer look at the first of them.
|||||||||||||||||||
Sbjct: 69786 tggtgaagtgtgtttcttg 69804
-This alignment was located on the human chromosome 7. The fragment on
-which part of the query was found had a total length of 176383. Only 19
-of the nucleotides matched and the matching sequence ran from character
-35 to 53 in the query sequence and from 69786 to 69804 in the fragment
-on chromosome 7. If you are still reading at this point, you are
-probably interested in finding out more about Computational Biology and
-you might appreciate the following hints.
+ This alignment was located on the human chromosome 7. The fragment
+on which part of the query was found had a total length of 176383. Only
+19 of the nucleotides matched and the matching sequence ran from
+character 35 to 53 in the query sequence and from 69786 to 69804 in the
+fragment on chromosome 7. If you are still reading at this point, you
+are probably interested in finding out more about Computational Biology
+and you might appreciate the following hints.
1. There is a book called `Introduction to Computational Biology' by
Michael S. Waterman, which is worth reading if you are seriously
interested. You can find a good book review on the Internet.
2. While Waterman's book can explain to you the algorithms employed
- internally in the database search engines, most practicioners
+ internally in the database search engines, most practitioners
prefer to approach the subject differently. The applied side of
Computational Biology is called Bioinformatics, and emphasizes the
tools available for day-to-day work as well as how to actually
@@ -3740,6 +3730,7 @@ GNU Free Documentation License
******************************
Version 1.2, November 2002
+
Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -4093,7 +4084,7 @@ GNU Free Documentation License
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
translation of this License, and all the license notices in the
- Document, and any Warrany Disclaimers, provided that you also
+ Document, and any Warranty Disclaimers, provided that you also
include the original English version of this License and the
original versions of those notices and disclaimers. In case of a
disagreement between the translation and the original version of
@@ -4148,18 +4139,18 @@ notices just after the title page:
A copy of the license is included in the section entitled ``GNU
Free Documentation License''.
-If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
-replace the "with...Texts." line with this:
+ If you have Invariant Sections, Front-Cover Texts and Back-Cover
+Texts, replace the "with...Texts." line with this:
with the Invariant Sections being LIST THEIR TITLES, with
the Front-Cover Texts being LIST, and with the Back-Cover Texts
being LIST.
-If you have Invariant Sections without Cover Texts, or some other
+ If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.
-If your document contains nontrivial examples of program code, we
+ If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License, to
permit their use in free software.
@@ -4170,258 +4161,244 @@ File: gawkinet.info, Node: Index, Prev: GNU Free Documentation License, Up: T
Index
*****
+
* Menu:
-* /inet/ files (gawk): Gawk Special Files. (line 490)
-* /inet/raw special files (gawk): File /inet/raw. (line 712)
-* /inet/tcp special files (gawk): File /inet/tcp. (line 647)
-* /inet/udp special files (gawk): File /inet/udp. (line 679)
-* advanced features, network connections: Troubleshooting. (line 834)
-* agent <1>: MOBAGWHO. (line 2766)
-* agent: Challenges. (line 1887)
-* AI: Challenges. (line 1887)
-* apache <1>: MOBAGWHO. (line 2802)
-* apache: WEBGRAB. (line 2372)
-* Bioinformatics: PROTBASE. (line 3590)
-* BLAST, Basic Local Alignment Search Tool: PROTBASE. (line 3369)
-* blocking: Making Connections. (line 383)
-* Boutell, Thomas: STATIST. (line 2396)
-* CGI (Common Gateway Interface): MOBAGWHO. (line 2802)
+* /inet/ files (gawk): Gawk Special Files. (line 34)
+* /inet/raw special files (gawk): File /inet/raw. (line 6)
+* /inet/tcp special files (gawk): File /inet/tcp. (line 6)
+* /inet/udp special files (gawk): File /inet/udp. (line 6)
+* advanced features, network connections: Troubleshooting. (line 6)
+* agent <1>: MOBAGWHO. (line 6)
+* agent: Challenges. (line 76)
+* AI: Challenges. (line 76)
+* apache <1>: MOBAGWHO. (line 42)
+* apache: WEBGRAB. (line 72)
+* Bioinformatics: PROTBASE. (line 227)
+* BLAST, Basic Local Alignment Search Tool: PROTBASE. (line 6)
+* blocking: Making Connections. (line 35)
+* Boutell, Thomas: STATIST. (line 6)
+* CGI (Common Gateway Interface): MOBAGWHO. (line 42)
* CGI (Common Gateway Interface), dynamic web pages and: Web page.
- (line 1130)
-* CGI (Common Gateway Interface), library: CGI Lib. (line 1418)
-* clients: Making Connections. (line 369)
-* Clinton, Bill: Challenges. (line 1870)
-* Common Gateway Interface, See CGI: Web page. (line 1130)
-* Computational Biology: PROTBASE. (line 3590)
-* contest: Challenges. (line 1817)
-* cron utility: STOXPRED. (line 3068)
-* CSV format: STOXPRED. (line 3173)
-* dark corner, RAW protocol: File /inet/raw. (line 719)
-* Dow Jones Industrial Index: STOXPRED. (line 3089)
-* ELIZA program: Simple Server. (line 1606)
-* email: Email. (line 1045)
-* FASTA/Pearson format: PROTBASE. (line 3465)
+ (line 46)
+* CGI (Common Gateway Interface), library: CGI Lib. (line 11)
+* clients: Making Connections. (line 21)
+* Clinton, Bill: Challenges. (line 59)
+* Common Gateway Interface, See CGI: Web page. (line 46)
+* Computational Biology: PROTBASE. (line 227)
+* contest: Challenges. (line 6)
+* cron utility: STOXPRED. (line 23)
+* CSV format: STOXPRED. (line 128)
+* dark corner, RAW protocol: File /inet/raw. (line 13)
+* Dow Jones Industrial Index: STOXPRED. (line 44)
+* ELIZA program: Simple Server. (line 11)
+* email: Email. (line 11)
+* FASTA/Pearson format: PROTBASE. (line 102)
* FDL (Free Documentation License): GNU Free Documentation License.
- (line 3742)
-* filenames, for network access: Gawk Special Files. (line 485)
-* files, /inet/ (gawk): Gawk Special Files. (line 490)
-* files, /inet/raw (gawk): File /inet/raw. (line 712)
-* files, /inet/tcp (gawk): File /inet/tcp. (line 647)
-* files, /inet/udp (gawk): File /inet/udp. (line 679)
-* finger utility: Setting Up. (line 981)
+ (line 6)
+* filenames, for network access: Gawk Special Files. (line 29)
+* files, /inet/ (gawk): Gawk Special Files. (line 34)
+* files, /inet/raw (gawk): File /inet/raw. (line 6)
+* files, /inet/tcp (gawk): File /inet/tcp. (line 6)
+* files, /inet/udp (gawk): File /inet/udp. (line 6)
+* finger utility: Setting Up. (line 22)
* Free Documentation License (FDL): GNU Free Documentation License.
- (line 3742)
-* FTP (File Transfer Protocol): Basic Protocols. (line 316)
-* gawk, networking: Using Networking. (line 414)
-* gawk, networking, connections <1>: TCP Connecting. (line 781)
-* gawk, networking, connections: Special File Fields.
- (line 549)
-* gawk, networking, filenames: Gawk Special Files. (line 485)
-* gawk, networking, See Also email: Email. (line 1040)
-* gawk, networking, service, establishing: Setting Up. (line 965)
-* gawk, networking, troubleshooting: Caveats. (line 1791)
-* gawk, web and, See web service: Interacting Service.
- (line 1214)
-* getline command: TCP Connecting. (line 786)
-* GETURL program: GETURL. (line 2050)
-* GIF image format <1>: STATIST. (line 2396)
-* GIF image format: Web page. (line 1130)
+ (line 6)
+* FTP (File Transfer Protocol): Basic Protocols. (line 29)
+* gawk, networking: Using Networking. (line 6)
+* gawk, networking, connections <1>: TCP Connecting. (line 6)
+* gawk, networking, connections: Special File Fields. (line 49)
+* gawk, networking, filenames: Gawk Special Files. (line 29)
+* gawk, networking, See Also email: Email. (line 6)
+* gawk, networking, service, establishing: Setting Up. (line 6)
+* gawk, networking, troubleshooting: Caveats. (line 6)
+* gawk, web and, See web service: Interacting Service. (line 6)
+* getline command: TCP Connecting. (line 11)
+* GETURL program: GETURL. (line 6)
+* GIF image format <1>: STATIST. (line 6)
+* GIF image format: Web page. (line 46)
* GNU Free Documentation License: GNU Free Documentation License.
- (line 3742)
-* GNU/Linux <1>: REMCONF. (line 2107)
-* GNU/Linux <2>: Interacting. (line 931)
-* GNU/Linux: Troubleshooting. (line 882)
-* GNUPlot utility <1>: STATIST. (line 2396)
-* GNUPlot utility: Interacting Service.
- (line 1396)
-* Hoare, C.A.R. <1>: PROTBASE. (line 3369)
-* Hoare, C.A.R.: MOBAGWHO. (line 2766)
-* hostname field: Special File Fields.
- (line 529)
-* HTML (Hypertext Markup Language): Web page. (line 1114)
-* HTTP (Hypertext Transfer Protocol) <1>: Web page. (line 1090)
-* HTTP (Hypertext Transfer Protocol): Basic Protocols. (line 316)
+ (line 6)
+* GNU/Linux <1>: REMCONF. (line 6)
+* GNU/Linux <2>: Interacting. (line 27)
+* GNU/Linux: Troubleshooting. (line 54)
+* GNUPlot utility <1>: STATIST. (line 6)
+* GNUPlot utility: Interacting Service. (line 189)
+* Hoare, C.A.R. <1>: PROTBASE. (line 6)
+* Hoare, C.A.R.: MOBAGWHO. (line 6)
+* hostname field: Special File Fields. (line 29)
+* HTML (Hypertext Markup Language): Web page. (line 30)
+* HTTP (Hypertext Transfer Protocol) <1>: Web page. (line 6)
+* HTTP (Hypertext Transfer Protocol): Basic Protocols. (line 29)
* HTTP (Hypertext Transfer Protocol), record separators and: Web page.
- (line 1114)
-* HTTP server, core logic: Interacting Service.
- (line 1214)
-* Humphrys, Mark: Simple Server. (line 1774)
-* Hypertext Markup Language (HTML): Web page. (line 1114)
-* Hypertext Transfer Protocol, See HTTP: Web page. (line 1090)
-* image format: STATIST. (line 2396)
-* images, in web pages: Interacting Service.
- (line 1396)
-* images, retrieving over networks: Web page. (line 1130)
+ (line 30)
+* HTTP server, core logic: Interacting Service. (line 6)
+* Humphrys, Mark: Simple Server. (line 179)
+* Hypertext Markup Language (HTML): Web page. (line 30)
+* Hypertext Transfer Protocol, See HTTP: Web page. (line 6)
+* image format: STATIST. (line 6)
+* images, in web pages: Interacting Service. (line 189)
+* images, retrieving over networks: Web page. (line 46)
* input/output, two-way, See Also gawk, networking: Gawk Special Files.
- (line 475)
-* Internet, See networks: Interacting. (line 952)
-* JavaScript: STATIST. (line 2446)
-* Linux <1>: REMCONF. (line 2107)
-* Linux <2>: Interacting. (line 931)
-* Linux: Troubleshooting. (line 882)
-* Lisp: MOBAGWHO. (line 2858)
-* localport field: Gawk Special Files. (line 490)
-* Loebner, Hugh: Challenges. (line 1817)
-* Loui, Ronald: Challenges. (line 1887)
-* MAZE: MAZE. (line 2634)
-* Microsoft Windows: WEBGRAB. (line 2343)
-* Microsoft Windows, networking: Troubleshooting. (line 882)
-* Microsoft Windows, networking, ports: Setting Up. (line 996)
-* MiniSQL: REMCONF. (line 2212)
-* MOBAGWHO program: MOBAGWHO. (line 2766)
+ (line 19)
+* Internet, See networks: Interacting. (line 48)
+* JavaScript: STATIST. (line 56)
+* Linux <1>: REMCONF. (line 6)
+* Linux <2>: Interacting. (line 27)
+* Linux: Troubleshooting. (line 54)
+* Lisp: MOBAGWHO. (line 98)
+* localport field: Gawk Special Files. (line 34)
+* Loebner, Hugh: Challenges. (line 6)
+* Loui, Ronald: Challenges. (line 76)
+* MAZE: MAZE. (line 6)
+* Microsoft Windows: WEBGRAB. (line 43)
+* Microsoft Windows, networking: Troubleshooting. (line 54)
+* Microsoft Windows, networking, ports: Setting Up. (line 37)
+* MiniSQL: REMCONF. (line 111)
+* MOBAGWHO program: MOBAGWHO. (line 6)
* NCBI, National Center for Biotechnology Information: PROTBASE.
- (line 3369)
-* networks, gawk and: Using Networking. (line 414)
-* networks, gawk and, connections <1>: TCP Connecting. (line 781)
-* networks, gawk and, connections: Special File Fields.
- (line 549)
-* networks, gawk and, filenames: Gawk Special Files. (line 485)
-* networks, gawk and, See Also email: Email. (line 1040)
-* networks, gawk and, service, establishing: Setting Up. (line 965)
-* networks, gawk and, troubleshooting: Caveats. (line 1791)
-* networks, ports, reserved: Setting Up. (line 996)
-* networks, ports, specifying: Special File Fields.
- (line 518)
-* networks, See Also web pages: PANIC. (line 2008)
-* Numerical Recipes: STATIST. (line 2414)
-* ORS variable, HTTP and: Web page. (line 1114)
-* ORS variable, POP and: Email. (line 1070)
-* PANIC program: PANIC. (line 2008)
-* Perl: Using Networking. (line 422)
-* Perl, gawk networking and: Using Networking. (line 432)
-* Perlis, Alan: MAZE. (line 2634)
-* pipes, networking and: TCP Connecting. (line 805)
-* PNG image format <1>: STATIST. (line 2396)
-* PNG image format: Web page. (line 1130)
-* POP (Post Office Protocol): Email. (line 1040)
-* Post Office Protocol (POP): Email. (line 1040)
-* PostScript: STATIST. (line 2528)
-* PROLOG: Challenges. (line 1887)
-* PROTBASE: PROTBASE. (line 3369)
-* protocol field: Special File Fields.
- (line 511)
-* PS image format: STATIST. (line 2396)
-* Python: Using Networking. (line 422)
-* Python, gawk networking and: Using Networking. (line 432)
-* RAW protocol: File /inet/raw. (line 712)
-* record separators, HTTP and: Web page. (line 1114)
-* record separators, POP and: Email. (line 1070)
-* REMCONF program: REMCONF. (line 2107)
-* remoteport field: Gawk Special Files. (line 490)
-* robot <1>: WEBGRAB. (line 2306)
-* robot: Challenges. (line 1896)
-* RS variable, HTTP and: Web page. (line 1114)
-* RS variable, POP and: Email. (line 1070)
-* servers <1>: Setting Up. (line 981)
-* servers: Making Connections. (line 362)
-* servers, as hosts: Special File Fields.
- (line 529)
-* servers, HTTP: Interacting Service.
- (line 1214)
-* servers, web: Simple Server. (line 1601)
-* Simple Mail Transfer Protocol (SMTP): Email. (line 1040)
-* SMTP (Simple Mail Transfer Protocol) <1>: Email. (line 1040)
-* SMTP (Simple Mail Transfer Protocol): Basic Protocols. (line 316)
-* SPAK utility: File /inet/raw. (line 727)
-* STATIST program: STATIST. (line 2396)
-* STOXPRED program: STOXPRED. (line 3051)
-* synchronous communications: Making Connections. (line 383)
-* Tcl/Tk: Using Networking. (line 422)
+ (line 6)
+* networks, gawk and: Using Networking. (line 6)
+* networks, gawk and, connections <1>: TCP Connecting. (line 6)
+* networks, gawk and, connections: Special File Fields. (line 49)
+* networks, gawk and, filenames: Gawk Special Files. (line 29)
+* networks, gawk and, See Also email: Email. (line 6)
+* networks, gawk and, service, establishing: Setting Up. (line 6)
+* networks, gawk and, troubleshooting: Caveats. (line 6)
+* networks, ports, reserved: Setting Up. (line 37)
+* networks, ports, specifying: Special File Fields. (line 18)
+* networks, See Also web pages: PANIC. (line 6)
+* Numerical Recipes: STATIST. (line 24)
+* ORS variable, HTTP and: Web page. (line 30)
+* ORS variable, POP and: Email. (line 36)
+* PANIC program: PANIC. (line 6)
+* Perl: Using Networking. (line 14)
+* Perl, gawk networking and: Using Networking. (line 24)
+* Perlis, Alan: MAZE. (line 6)
+* pipes, networking and: TCP Connecting. (line 30)
+* PNG image format <1>: STATIST. (line 6)
+* PNG image format: Web page. (line 46)
+* POP (Post Office Protocol): Email. (line 6)
+* Post Office Protocol (POP): Email. (line 6)
+* PostScript: STATIST. (line 138)
+* PROLOG: Challenges. (line 76)
+* PROTBASE: PROTBASE. (line 6)
+* protocol field: Special File Fields. (line 11)
+* PS image format: STATIST. (line 6)
+* Python: Using Networking. (line 14)
+* Python, gawk networking and: Using Networking. (line 24)
+* RAW protocol: File /inet/raw. (line 6)
+* record separators, HTTP and: Web page. (line 30)
+* record separators, POP and: Email. (line 36)
+* REMCONF program: REMCONF. (line 6)
+* remoteport field: Gawk Special Files. (line 34)
+* robot <1>: WEBGRAB. (line 6)
+* robot: Challenges. (line 85)
+* RS variable, HTTP and: Web page. (line 30)
+* RS variable, POP and: Email. (line 36)
+* servers <1>: Setting Up. (line 22)
+* servers: Making Connections. (line 14)
+* servers, as hosts: Special File Fields. (line 29)
+* servers, HTTP: Interacting Service. (line 6)
+* servers, web: Simple Server. (line 6)
+* Simple Mail Transfer Protocol (SMTP): Email. (line 6)
+* SMTP (Simple Mail Transfer Protocol) <1>: Email. (line 6)
+* SMTP (Simple Mail Transfer Protocol): Basic Protocols. (line 29)
+* SPAK utility: File /inet/raw. (line 21)
+* STATIST program: STATIST. (line 6)
+* STOXPRED program: STOXPRED. (line 6)
+* synchronous communications: Making Connections. (line 35)
+* Tcl/Tk: Using Networking. (line 14)
* Tcl/Tk, gawk and <1>: Some Applications and Techniques.
- (line 1977)
-* Tcl/Tk, gawk and: Using Networking. (line 432)
-* TCP (Transmission Control Protocol) <1>: File /inet/tcp. (line 647)
-* TCP (Transmission Control Protocol): Using Networking. (line 437)
+ (line 22)
+* Tcl/Tk, gawk and: Using Networking. (line 24)
+* TCP (Transmission Control Protocol) <1>: File /inet/tcp. (line 6)
+* TCP (Transmission Control Protocol): Using Networking. (line 29)
* TCP (Transmission Control Protocol), connection, establishing: TCP Connecting.
- (line 781)
-* TCP (Transmission Control Protocol), UDP and: Interacting. (line 952)
-* TCP/IP, protocols, selecting: Special File Fields.
- (line 511)
-* TCP/IP, sockets and: Gawk Special Files. (line 475)
-* Transmission Control Protocol, See TCP: Using Networking. (line 437)
-* troubleshooting, gawk, networks: Caveats. (line 1791)
-* troubleshooting, networks, connections: Troubleshooting. (line 834)
-* troubleshooting, networks, timeouts: Caveats. (line 1803)
-* UDP (User Datagram Protocol): File /inet/udp. (line 679)
-* UDP (User Datagram Protocol), TCP and: Interacting. (line 952)
-* Unix, network ports and: Setting Up. (line 996)
-* URLCHK program: URLCHK. (line 2225)
-* User Datagram Protocol, See UDP: File /inet/udp. (line 679)
-* vertical bar (|), |& operator (I/O): TCP Connecting. (line 800)
-* VRML: MAZE. (line 2634)
-* web browsers, See web service: Interacting Service.
- (line 1214)
-* web pages: Web page. (line 1090)
-* web pages, images in: Interacting Service.
- (line 1396)
-* web pages, retrieving: GETURL. (line 2050)
-* web servers: Simple Server. (line 1601)
-* web service <1>: PANIC. (line 2008)
-* web service: Primitive Service. (line 1156)
-* WEBGRAB program: WEBGRAB. (line 2306)
-* Weizenbaum, Joseph: Simple Server. (line 1606)
-* XBM image format: Interacting Service.
- (line 1396)
-* Yahoo! <1>: STOXPRED. (line 3051)
-* Yahoo!: REMCONF. (line 2107)
-* | (vertical bar), |& operator (I/O): TCP Connecting. (line 800)
+ (line 6)
+* TCP (Transmission Control Protocol), UDP and: Interacting. (line 48)
+* TCP/IP, protocols, selecting: Special File Fields. (line 11)
+* TCP/IP, sockets and: Gawk Special Files. (line 19)
+* Transmission Control Protocol, See TCP: Using Networking. (line 29)
+* troubleshooting, gawk, networks: Caveats. (line 6)
+* troubleshooting, networks, connections: Troubleshooting. (line 6)
+* troubleshooting, networks, timeouts: Caveats. (line 18)
+* UDP (User Datagram Protocol): File /inet/udp. (line 6)
+* UDP (User Datagram Protocol), TCP and: Interacting. (line 48)
+* Unix, network ports and: Setting Up. (line 37)
+* URLCHK program: URLCHK. (line 6)
+* User Datagram Protocol, See UDP: File /inet/udp. (line 6)
+* vertical bar (|), |& operator (I/O): TCP Connecting. (line 25)
+* VRML: MAZE. (line 6)
+* web browsers, See web service: Interacting Service. (line 6)
+* web pages: Web page. (line 6)
+* web pages, images in: Interacting Service. (line 189)
+* web pages, retrieving: GETURL. (line 6)
+* web servers: Simple Server. (line 6)
+* web service <1>: PANIC. (line 6)
+* web service: Primitive Service. (line 6)
+* WEBGRAB program: WEBGRAB. (line 6)
+* Weizenbaum, Joseph: Simple Server. (line 11)
+* XBM image format: Interacting Service. (line 189)
+* Yahoo! <1>: STOXPRED. (line 6)
+* Yahoo!: REMCONF. (line 6)
+* | (vertical bar), |& operator (I/O): TCP Connecting. (line 25)

Tag Table:
-Node: Top2000
-Node: Preface5688
-Node: Introduction7063
-Node: Stream Communications8088
-Node: Datagram Communications9261
-Node: The TCP/IP Protocols10892
-Ref: The TCP/IP Protocols-Footnote-111576
-Node: Basic Protocols11733
-Node: Ports13055
-Node: Making Connections14460
-Ref: Making Connections-Footnote-117027
-Ref: Making Connections-Footnote-217074
-Node: Using Networking17255
-Node: Gawk Special Files19609
-Node: Special File Fields21609
-Ref: table-inet-components25353
-Node: Comparing Protocols28235
-Node: File /inet/tcp28824
-Node: File /inet/udp29844
-Node: File /inet/raw30959
-Ref: File /inet/raw-Footnote-133974
-Node: TCP Connecting34051
-Node: Troubleshooting36380
-Ref: Troubleshooting-Footnote-139424
-Node: Interacting39964
-Node: Setting Up42684
-Node: Email46166
-Node: Web page48485
-Ref: Web page-Footnote-151272
-Node: Primitive Service51466
-Node: Interacting Service54194
-Ref: Interacting Service-Footnote-163291
-Node: CGI Lib63320
-Node: Simple Server70269
-Ref: Simple Server-Footnote-177975
-Node: Caveats78073
-Node: Challenges79213
-Node: Some Applications and Techniques87874
-Node: PANIC90322
-Node: GETURL92034
-Node: REMCONF94650
-Node: URLCHK100114
-Node: WEBGRAB103937
-Node: STATIST108367
-Ref: STATIST-Footnote-1120029
-Node: MAZE120471
-Node: MOBAGWHO126646
-Ref: MOBAGWHO-Footnote-1140547
-Node: STOXPRED140599
-Node: PROTBASE154809
-Node: Links167844
-Node: GNU Free Documentation License171278
-Node: Index193671
+Node: Top2007
+Node: Preface5697
+Node: Introduction7072
+Node: Stream Communications8098
+Node: Datagram Communications9271
+Node: The TCP/IP Protocols10902
+Ref: The TCP/IP Protocols-Footnote-111586
+Node: Basic Protocols11743
+Node: Ports13065
+Node: Making Connections14470
+Ref: Making Connections-Footnote-117051
+Ref: Making Connections-Footnote-217098
+Node: Using Networking17279
+Node: Gawk Special Files19633
+Node: Special File Fields21637
+Ref: table-inet-components25387
+Node: Comparing Protocols27299
+Node: File /inet/tcp27888
+Node: File /inet/udp28914
+Node: File /inet/raw30035
+Ref: File /inet/raw-Footnote-133068
+Node: TCP Connecting33148
+Node: Troubleshooting35486
+Ref: Troubleshooting-Footnote-138537
+Node: Interacting39081
+Node: Setting Up41811
+Node: Email45305
+Node: Web page47631
+Ref: Web page-Footnote-150436
+Node: Primitive Service50633
+Node: Interacting Service53367
+Ref: Interacting Service-Footnote-162496
+Node: CGI Lib62528
+Node: Simple Server69489
+Ref: Simple Server-Footnote-177219
+Node: Caveats77320
+Node: Challenges78463
+Node: Some Applications and Techniques87130
+Node: PANIC89587
+Node: GETURL91305
+Node: REMCONF93928
+Node: URLCHK99404
+Node: WEBGRAB103239
+Node: STATIST107689
+Ref: STATIST-Footnote-1119397
+Node: MAZE119842
+Node: MOBAGWHO126030
+Ref: MOBAGWHO-Footnote-1139974
+Node: STOXPRED140029
+Node: PROTBASE154284
+Node: Links167366
+Node: GNU Free Documentation License170800
+Node: Index193204

End Tag Table