summaryrefslogtreecommitdiff
path: root/example/README
blob: 77081be8eab242e524adb0a036956cdfab6c2edd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
This file is example/README.  It contains brief descriptions of the
examples in this directory.  Also listed are scripts from the Expect
archive at ftp.cme.nist.gov (See Expect's README for how to retrieve
these from).  You are welcome to send me additional scripts.  A number
of Expect scripts are also available in the Tcl archive, available via
anonymous ftp at harbor.ecn.purdue.edu

Note that on some systems, some of the scripts (notably kibitz and
dislocate) require that Expect be installed.  (Merely compiling the
expect binary is not enough.)

--------------------
Expect scripts (See next section for example Tk scripts)
--------------------
Entries marked with "m" have their own man page.
Entries marked with "a" live in the Expect archive (see above).

	archie - mails back response after talking to archie ftp-catalog.
   m	autoexpect - generate an Expect script from watching a session
	autopasswd - runs passwd non-interactively for superuser.
   a	bc - Uses bc to do arbitrary precision math.
	beer.exp - 99 Bottles of Beer On The Wall, Expect-style.
	beer.exp.out - sample output from beer.exp (but you really have to
		run it to see the timing aspect).
   a	bonfield.exp - solve Jim Bonfield's puzzle that won the 1991 Obfuscated
		C Code contest.
	carpal - warn about typing for too long without a break.
	chess.exp - has two chess games play each other.
   m	cryptdir - encrypt all files in a directory.
   m    decryptdir - decrypt all files in a directory.
   m	dislocate - allow disconnection/reconnection to background processes.
	dvorak - dvorak keyboard.
   a	eftp - ftp client with miscellaneous frills (also see rftp below).
	expectd.proto - telnet daemon.
	ftp-inband - does file transfer over telnet, rlogin, etc.
	ftp-rfc - retrieve a DoD RFC from uunet via anonymous ftp.
	ftp-talk-radio - gets "Internet Talk Radio" files from a host.
	gethostbyaddr - translates internet address to name (with a higher
		success rate than nslookup).  Easier to use, too.
	getpassck - test for presence of bug in getpass.
	irsh - run interactive commands via rsh
   m	kibitz - lets two people control a program at the same time.
		Lots of uses.  I.e., You can help another person remotely.
		Can run an editor and log a transcript of a conversation.
   a	libro-II - connect to Libro-II, the NIST library catalog.
	lpunlock - unhangs a printer which says it is "waiting for lock".
   a	mirror_file - mirror a file from another ftp site, copying file only
		if changed.
   a	mirror_dir - mirror a directory from another ftp site, copying only
		files which have changed.
   m	multixterm - drive several xterms simultaneously.
   m	mkpasswd - generates good passwords, optionally runs passwd with them.
   a	mx - return any MX records for the given host.
   a	noidle - run a shell which avoids being 'autologged out'.
   a	pager.alpha - sends a message to a (Alpha brand) pager.
   a	pager.mercury - sends a message to a (Mercury brand) pager.
   m	passmass - sets passwd on many machines simultaneously.
        passwd.html - form to change a login passwd
	passwd.cgi - CGI script to respond to passwd.html form
	passwdprompt - Prompt from stdin and echo *'s.
   a	ping-and-page - Ping list of hosts.  If any down, page system admin.
	read1char - read a single character for the shell, Perl, etc.
	reprompt - like timed-read but reprompt after given amount of time.
	rlogin-cwd - rlogin giving you same current working directory.
		(Compare to telnet-cwd and xrlogin.)
	robohunt - plays the game of hunt (from Berkeley).
		It's more of a wild player than good, but amusing to watch.
		Fun to throw against people who don't know about it.
	rogue.exp - finds a good game of rogue.
	rftp - recursive ftp (assumes UNIX-style ftpd at other end).
   a	s-key-rlogin - 	Automate rlogin (or telnet) using s/key
   a	scripttoggle - Like UNIX script command, but allow enabling/disabling
		of recording.
   a	slip.shar - scripts to keep your SLIP link alive.
	su.exp - start up an 'su' and run the argument.
	telnet-cwd - telnet giving you same current working directory.
	telnet-in-bg - put telnet (or any program) in bg, saving all remaining
		output to a logfile.
   a	term-rlogin - run Term over rlogin.  Good for traversing PPP/SLIP or
		firewall rlogin connections.
   a	term-start - start up Term (a sophisticated UNIX-to-UNIX serial line
		handler).
   a	timed-choice - offer user a timed choice of responses.
	timed-read - a timed read for the shell, Perl, etc.  Compare with
		reprompt example.
   m	timed-run - run a program for only a given amount of time.
   a	try-phone-list - automate logging in to remote system, trying numbers
		from a list until finding one that works.
   m	unbuffer - disables output buffering that normally occurs when
		programs are redirected.
	virterm - example of terminal emulation and expect operations on
		character graphics using arrays (compare to term_expect
		(below) which uses Tk widget).
	vrfy - verifies an email address using SMTP/VRFY to remote site.
   a	waste-collection - Contact NIST service for hazardous waste pickup.
	weather - retrieves weather forecasts.
   m	xkibitz - similar to kibitz but uses X Window System for handling
		communication.  Also, allows users to be added dynamically.
	xrlogin - rlogin giving you same DISPLAY.  (Compare to rlogin-cwd.)

To run, for example, chess.exp, type:

	expect chess.exp

If expect is installed and your system supports the #! magic you can
invoke it as:

	chess.exp

Each of these examples necessarily depends upon other binaries in the
system.  For example, chess.exp depends upon the "usual" UNIX chess
program being present.  If any of these programs are different,
it may cause the associated script to misbehave.

Please use the ".exp" extension on scripts that might otherwise have
names that could be confused with the real program, such as "rogue.exp".
Scripts that have unique names do not need the extension, such as "rftp".

--------------------
Sample Expectk scripts
--------------------
Entries marked with "m" have their own man page.

	term_expect - template for doing expect operations on character
		graphics.
   m	tknewsbiff - pops up a window (or plays sounds, etc) when news
		arrives in selected newsgroups.
   	tkpasswd - Tk GUI for changing passwords.
	tkterm - Tk terminal emulator in a Tk text widget.
	xpstat - provide an X window front end to the xpilot game.

--------------------
Sample C and C++ programs that use the Expect library
--------------------

	chesslib.c - same thing as chess.exp, but in C.
	chesslib2.c - ditto, but uses popen and stream-style I/O.
	chesslib++.c - ditto, but for C++.
   m	unbuffer.c - same as unbuffer example but standalone

You may change the value of CC or CPLUSPLUS in the Makefile, to
compile under gcc or other compilers.  However, you may have to edit
the lines defining where the libraries are.