When you log in to a host, you have to provide a username and (usually) a password. It is possible to make use of certain services without this identification.
ftp are two examples of services that can be obtained anonymously—without logging in. The programs that provide such services are called daemons. Traditionally, a daemon is a background process that is started or woken when it receives a request for service.
UNIX systems often use a program called
inetd to start these daemons as necessary. For example, when you
ftp to a host,
inetd on that host sees the request for
ftp service and starts a program called
ftp daemon”) to provide you with service. There are many other daemons such as
telnet daemon”) and
You can write Expect scripts that behave just like these daemons. Then users will be able to run your Expect scripts without logging in. As the large number of daemons on any host suggests, there are many uses for offering services in this manner. And Expect makes it particularly easy to build a daemon—to offer remote access to partially or completely automated interactive services. In the next section, I will discuss how to use Expect to enable Gopher and Mosaic to automate connections that would otherwise require human interaction.
Simple Expect scripts require no change to run as a daemon. For example, the following Expect script prints out the contents of