resetting manifest requested domain to floor
[platform/upstream/expect.git] / NEWS
1 This file is the NEWS file from the Expect distribution.
2
3 ======================================================================
4 ======================================================================
5
6 Date: 08/01/00
7
8 ** SUMMARY
9
10 Expect 5.32 is being released in conjuction with Tcl 8.3.2.
11 This is a fairly minor update with no feature changes but with
12 a number of useful bug fixes in the way expects uses the new
13 regular expression engine and the UTF-8 features of Tcl.
14 Details are in the HISTORY and ChangeLog files.
15
16 ======================================================================
17 ======================================================================
18
19 Date: 10/22/99
20
21 ** SUMMARY
22
23 Expect 5.31 now works with Tcl 8.2.  Expect 5.31 does NOT work with
24 prior releases of Tcl.  Thanks to an incredible amount of work by
25 Scott Stanton, Henry Spencer, Melissa Hirschl, and funding from
26 Scriptics for making this possible.
27
28 ** NEW FEATURES
29
30 What?  You mean that working with Tcl 8.2 isn't enough?????
31
32 Expect supports Tcl's new regexp engine.
33
34 Expect supports null bytes in strings directly.  (You no longer have
35 to use the "null" keyword to send or match nulls.  Of course, the
36 "null" keyword will continue to be supported.)  Null removal (on
37 input) is still enabled by default since nulls are almost never
38 intended for end-user consumption in interactive dialogues.
39
40 ** CHANGES IN BEHAVIOR (POTENTIAL INCOMPATIBILITIES)
41
42 The interpreter command used to exit upon eof.  Now it uses "-eof
43 script" to control this behavior.  The default behavior is to return.
44 (This change was required because Expect now gives control to Tcl upon
45 exit and Tcl waits (potentially forever) for all processes to die on
46 exit.)  Explicit calls to interpreter are almost non-existent.
47 However, you should look for *implicit* calls via interact commands
48 with a pattern but no action.  This required changes in the examples:
49 dislocate, dvorak, kibitz, and xkibitz.
50
51 Indirect variables can no longer start with "exp".  Such variables
52 will be interpreted as channel names.
53
54 Old-style regexps may need conversion.  If you have been protecting
55 regexps containing backslashes with {}, then you need to examine all
56 your backslashes since the new regexp engine interprets backslash
57 sequences (such as \n) itself.  For example:
58
59         expect "\n"         (works the same in Tcl 8.0 and 8.1)
60         expect {\n}         (works differently in Tcl 8.0 and 8.1)
61
62 Scriptics has also created a new-regexp-features page which you should
63 read: http://www.scriptics.com/support/howto/regexp81.html.  Some of
64 the new features allow much more efficient regexps than before.  For
65 example, non-greedy quantifiers can replace [split] looping
66 constructions with a single regexp, enabling Tcl to parse very
67 efficiently.  For the whole story, read the re_syntax man page.
68
69 The interact command's regexp matching no longer skips nulls.  (I'd be
70 surprised if anyone misses this.  At least I hope ....)
71
72 Expect's C library now reports failures in spawn's underlying exec
73 directly (by returning -1) rather than the way it used to (as data in
74 the pty).  This makes user code more robust.  However, it requires you
75 to simplify your code, alas.  See the chesslib.c example.
76
77 Linking with Expect's C library no longer requires the Tcl library
78 (unless, of course, you make Tcl calls yourself).  Tcl is still
79 required to build the library in the first place, however.
80
81 ** CHANGES IN BEHAVIOR (SHOULD NOT CAUSE INCOMPATIBILITIES)
82
83 The match_max command now controls by bytes, not chars.  This won't
84 cause problems unless your existing scripts are interacting using
85 sizeable chunks of multibyte characters.  (If you don't know what I'm
86 talking about, ignore this.)
87
88 The Make/configure suite now corresponds to the TEA conventions (at
89 least in theory; the conventions are changing regularly so it's hard
90 to be less vague on this point).  Significantly, this means that you
91 should be able to use the same configure flags as when compiling Tcl
92 or any other TEA-compatible extension.  (See the INSTALL file.)
93
94 The values of special variables such as exp_spawn_id_any have changed.
95 (The values were never documented so you shouldn't have been using
96 them anyway.)
97
98 Spawn ids now appear as "exp...".  (They used to be small integers.)
99 Do not assume that spawn ids will continue to be represented in any
100 particular way (other than unique strings).
101
102 ** OTHER NOTES
103
104 Expect uses channels.  There is an Expect channel type.  It is
105 possible to use Tcl's channel commands, such as fconfigure, to change
106 the encoding.  However, Expect layers its own buffering system on top
107 of Tcl's channel handler so don't expect intuitive behavior when using
108 commands such as gets and puts.  Unless you know what you're doing, I
109 recommend manipulating the Expect channels only with the expect
110 commands.
111
112 Some effort was made to make Expect support threads, however it is not
113 complete.  You can compile Expect with threads enabled but don't run
114 Expect in multiple threads just yet.
115
116 So much code has changed, there are bound to be bugs in dark corners.
117 Please let me know of such cases.  The best response will come by
118 supplying a simple test case that can be added to Expect's test suite.
119
120 In places where the behavior of Expect was not precisely documented,
121 full advantage was taken to do something different :-)
122
123 Several esoteric bugs were fixed.
124
125 Although Expect itself uses Henry Spencer's new regexp engine,
126 Expect's C library still uses his original regexp engine.
127
128 No testing has been done of the poll and non-event subsystems.  (These
129 are used on systems which don't support select on ptys or ttys.  Some
130 minor work needs to be done on them (because the event subsystem was
131 rewritten) which I'll probably do only if anyone requests it.
132
133 Many deprecated features (deprecated for many years!) have been
134 removed.  All such features were deprecated prior to Exploring Expect
135 so if that's how you learned Expect, you have nothing to worry about.
136 For example, Expect's getpid command predates Tcl's pid command and
137 it's been deprecated for, oh.... 6 years - wow!  Other deprecated features
138 include:
139   expect -timestamp (flag only; behavior itself was removed years ago)
140   expect -iwrite (flag only; behavior occurs all the time)
141   expect_version (use "exp_version" command)
142   expect_library (use "exp_library" global variable)
143   interact -eof (use "eof" keyword)
144   interact -timeout (use "timeout" keyword)
145   interact -timestamp (use "clock" command)
146   getpid (use "pid" command)
147   system stty (use "stty" command)
148
149 With this release, the following are deprecated:
150   timestamp (use "clock" command)
151   debugger (use a different one; there are very nice replacements
152      around.  Fortunately the Expect debugger is not something anyone
153      is wiring into their scripts, so for now, consider it on the
154      endangered species list.  Anyone still want this debugger?)
155
156 From now on, the most current snapshots of Expect will be found in the
157 Scriptics CVS repository.  Not all snapshots are official releases.
158
159 ======================================================================
160 ======================================================================
161
162 Date: 8/18/96
163
164 Expect now works with Tcl 8.0.
165
166 No changes were made to take advantage of 8.0 features such as
167 namespaces.  (If you want to put the Expect commands in a namespace,
168 declare a namespace before loading them in.)
169
170 Even though Tcl allows embedded nulls in commands, Expect still does
171 not.  Tcl still doesn't support embedded in patterns and regexps.
172 I'll wait til Tcl supports that before rewriting Expect's null
173 support.
174
175
176 ======================================================================
177 ======================================================================
178
179 Date: 9/28/96
180
181 There is now an Expect FAQ and home page.  Feedback is encouraged.
182 You can get to the FAQ from the home page and vice versa, so you only
183 need to remember one of the links, but here are both for completeness:
184
185 home page: http://expect.nist.gov
186 FAQ:       http://expect.nist.gov/FAQ.html
187
188
189
190 ======================================================================
191 ======================================================================
192 This section describes the changes to Expect 5, many due to changes
193 from Tcl 7.4 to 7.5.
194
195 Improvements
196 ==============================
197
198 You can now use expect_background from Tcl along with all the
199 Tcl-based event stuff such as "after".  You can also do fun things
200 such as have "after" actions run while expect is waiting for input.
201 It's worth comparing the difference between commands such as expect
202 (which waits in the event loop) and gets (which doesn't).
203
204 Incompatibilities
205 ==============================
206
207 libexpectk is gone.  Because of the event loop was moved into Tcl,
208 this is no longer necessary.  Just use the regular Expect library.
209 This only affects you if are hand-linking.
210
211 The name of the static C library now has the extension on the end -
212 just like Tcl.  This only affects you if are hand-linking.
213
214
215 ==============================
216 Some obvious questions and answers
217
218 Nothing in the user interface has changed.  All your old scripts
219 should run.  Tcl now has commands that replace Expect functionality in
220 the area of version control and date handling.  I encourage you to use
221 Tcl's support rather than Expect's for any new scripts that you write.
222 However, I won't be removing Expect's commands, so don't worry about
223 having to convert old scripts.
224
225 It is my understand that shared/dl libs work.  (I say "it is my
226 understanding", because my own environment doesn't handle it, sigh.
227 My system admins tell me that they're working on it.)  So I've had to
228 guess on some things - in fact, I've talked to a number of people and
229 I get the feeling that a lot of people are guessing on shared/dl libs.
230 I have yet to talk to anyone that REALLY understands this stuff (by
231 "understand", I mean "can write the configure/Makefile portably and
232 correctly".  So much for my griping.  In theory, the shared/dl support
233 is pretty much a freebie because Tcl itself provides all the support
234 for this.  (There is some reorganization that could be done to improve
235 shared library memory use - I'll get to it eventually - it shouldn't
236 affect most people.)  Don't send me complaints about shared/dl libs
237 unless you are *positive* it is something that I am responsible for.
238 Even if Tcl works and Expect fails, it is likely to be a Tcl error (or
239 more precisely, a configuration problem that is more appropriately
240 fixed from the Tcl distribution).
241
242 For Tcl-package purposes, Expect is called "Expect".  (Duh...)
243
244 Expect's multiple interpreter support is minimal.  It should work for
245 most things, serendipitously.  I haven't spent any time making this
246 perfect.
247
248 No, this release isn't portable to Windows or Mac.  Let me know if
249 you're seriously interested in a lot of work.  I'm not saying it's not
250 possible.  It's definitely possible and the porting working at Sun has
251 made it easier than before.  But it's still not a weekend hack.
252
253 ==============================
254 Building the code
255 ==============================
256
257 Expect builds as usual.  (See the INSTALL file for details.)
258
259 The only significant change is that Expect now has to find the
260 tclConfig.sh file (and tkConfig.sh if you want).  So if you like to
261 store Tcl where Expect can't find it, you'll need to use even more
262 configure flags than you used to.
263
264 Shared/dl Expect libraries are built if you configured Tcl for
265 shared/dl libraries.
266
267 All support for earlier versions of Tcl and Tk have been removed from
268 Expect.  For example, if you're still using Tcl 7.4 (or earlier),
269 don't bother to install this release.
270
271 ======================================================================
272 ======================================================================
273 This section describes the changes from Expect 4 to Expect 5.
274
275 The changes that people will find most interesting or annoying are as
276 follows.  Some of them may seem rather arbitrary but fix inconsistencies
277 leading to much cleaner coding both internally and externally.
278
279
280 -- Expect version 5.20 and above is designed to work with Tcl 7.5 and
281 Tk 4.1.  Expect 5.20 and above will not work with earlier versions.
282
283 -- Glob-style patterns do longest-possible matches (from the earliest
284 possible position) just like regexps.  Previously, they matched the
285 shortest-possible strings.  However, the documentation didn't actually
286 say this (it didn't say anything)
287
288 -- Exact patterns are now supported from expect.  Use the "-ex" flag.
289 Exact patterns work just like those in interact.  No special handling
290 is made of *, ^, etc.
291
292 -- The new command "expect_background" registers patterns that are to
293 be tested against spawned process output whenever it appears (i.e.,
294 asynchronously).  This only works in the Tk environment.  The
295 arguments are the same as the expect command.
296
297 -- expect_before and expect_after now handle their arguments like
298 expect_background.  Previously, a command such as "expect_before"
299 with no arguments deleted patterns for all spawn ids.  Now, it only
300 deletes patterns for the current spawn id.  Similarly with the "-i"
301 form.
302
303 -- expect_background/before/after support an -info flag to query what
304 the current patterns are.  The results are returned in such a way that
305 they can be re-used by a new expect command.
306
307 The -info flag must be the first flag in the command.  With no other
308 arguments, it returns the setting for the current spawn id.  With a -i
309 descriptor, information is returned for that spawn id.  The argument
310 -noindirect may be used to suppress indirects which also match a
311 direct spawn id.  Only a single -i specification may be given with
312 -info.  With the argument "-all", all spawn id specifications are
313 reported.
314
315 -- There is now a sleep command.  It understands decimal values such as
316
317         sleep .5
318
319 Interrupts and other asynchronous events are processed while Expect sleeps.
320
321 -- Traps now use Tcl's "Async" support.  This has advantages and
322 disadvantages.  One advantage is that traps have no chance of screwing
323 up the Tcl internals.  One disadvantage is that trap handlers are
324 delayed at certain specific times and places.  For example, a handler
325 cannot occur inside another handler.  While one handler is running,
326 all other handlers are blocked.  This is probably the most noticable
327 place where handlers are blocked.  Others are generally small windows,
328 so you shouldn't notice the delay in executing the handlers.
329
330 Several traps are initially defined:
331
332         trap exit {SIGINT SIGTERM}
333
334 If you use the -D flag to start the debugger, the following trap is
335 defined:
336
337         trap {exp_debug 1} SIGINT
338
339 You can, of course, override these.  In particular, if you have your
340 own "trap exit SIGINT", this will override the debugger trap.  Because
341 SIGINT is tied to exit (see above) by default anyway, you should
342 remove your own "trap exit SIGINT" unless you specifically do not want
343 to be able to get to the debugger by ^C.
344
345 If you want to define your own trap on SIGINT but still trap to the
346 debugger when it is running, use:
347
348         if ![exp_debug] {trap mystuff SIGINT}
349
350 Alternatively, you can trap to the debugger using some other signal.
351
352 The ONEXIT trap is no longer available.  Instead, say "exit -onexit ..."
353
354 Traps are now deleted by using the empty ({}) handler.  The current
355 handler is returned if no action is supplied.  With no arguments, trap
356 returns the signal number of the trap command currently being executed.
357
358 -- The wait command now returns a four element list if a valid child
359 was waited on.
360 Element 1: pid
361 Element 2: spawn id
362 Element 3: 0 (or -1 if there was an OS error)
363 Element 4: status (or errno if element 3 == -1)
364
365 -- expect and interact notes:
366
367 The timeout and eof patterns were initially named "-timeout" and
368 "-eof" but have been renamed "timeout" and "eof" to match those of
369 expect.  The ability to define default timeout/eof actions has been
370 removed.  (You can do this more easily by grouping spawn ids.)
371
372 expect and interact now support a "null" keyword to match an ASCII 0.
373 send supports -null and -break keywords.
374
375 Since a large number of special keywords have been added to interact,
376 a new keyword "-ex" for "exact" was added descriptive of its default
377 treatment of patterns.  This protects the next token from being
378 misinterpreted as a keyword.  The expect command provides "-gl" for
379 "glob" for analogous reasons.
380
381 Any string starting with "-" should be protected by the "-ex" or "-gl"
382 flag, even those that are not keywords currently.  (All strings
383 starting with "-" are reserved for future options.)
384
385 String start/end indices are no longer written to expect_out and
386 interact_out unless the -indices flag is given.
387
388 expect_out(spawn_id) is set to the spawn id associated with the spawn
389 id that produced the last output in an expect command.  For example,
390 you can use this to delete files that have closed, by removing this
391 element from an indirect spawn ids spec.  The same effect is
392 reproducable with interact (and interact_out(spawn_id)) but for
393 efficiency reasons, it requires the -iwrite flag before each pattern.
394
395 Expect's -i and interact's -i, -u, -input, and -output flags can now
396 describe a list of spawn ids.  So you can say things like:
397
398         interact -input "$id1 $id2 $id3" .... -output "$id1 $id2" ...
399
400 In this case, id1, 2, 3 would be sent to id1, and 2.
401
402 The spawn id may be given as a global variable name (called an
403 "indirect spawn id specification"), in which case, the variable
404 contains the list of spawn ids.  Whenever the variable is changed, the
405 new list of spawn ids is automatically used.  This is particularly
406 useful with any long running expect command such as expect_before,
407 expect_after, expect_background, and interact.
408
409 The -update flag was removed.  Use indirect spawn ids (see previous
410 paragraph).
411
412 -- interact notes:
413
414 Interact now support -input and -output flags that provide very
415 flexible means of moving data from/to multiple spawn ids in complex
416 ways (but very quickly).  It is possible to write most expect loops
417 using a simple interact statement.  For instance, the three way
418 interaction inside kibitz (between two users and a process) is written
419 this way:
420
421         interact {
422                 -output $shell
423                 -input $userin eof { . . . } -output $shell
424                 -input $shell -output "$user_spawn_id $userout"
425         }
426
427 -- send command notes:
428
429 It is possible to send a break by using the "-break" flag.
430
431 Any string starting with "-" should be protected by preceding it with
432 the "--" flag, even those that are not keywords currently.  (All
433 strings starting "-" are reserved for future options.)
434
435 -- The spawn command now takes an "-open" flag which in turns takes a
436 Tcl file as an argument.  This lets you treat raw devices, files, and
437 pipelines as spawned processes without using a pty.
438
439 This was actually in Expect 4, but I forgot to document it.  Oops!
440
441 -- The old "debug" command (which describes what Expect is doing
442 internally) was renamed "exp_internal".  "debug" (and "exp_debug") now
443 invoke the interactive debugger.
444
445 -- The new command "stty" now takes over the job of "system stty".  It
446 works much better, allowing POSIX-style redirection to affect other
447 ttys.  It otherwise takes arguments as "system stty" did.
448
449 -- The "-tcl" option to "return" has gone away.  (This was dangerous
450 to anyone that actually happened to return the value "-tcl".)
451 Instead, use inter_return.
452
453 -- Added exp_timestamp command to produce very fast timestamps.
454
455 -- Added exp_pid command to return pid of given spawn id.
456
457 -- The close command now takes an argument of "-onexec" with a following
458 0 or non-zero value.  For example, the follow command stops the
459 current spawn id from being closed when another process is exec'd or
460 spawn'd.
461
462         close -onexec 0
463
464 While "-onexec 1" returns it to the default condition where it will be
465 closed upon exec or spawn.
466
467 -- log_user now returns previous value.  It is acceptable to call now,
468 without arguments just to get the value.
469
470 -- The following forms are deprecated.  They will be allowed
471 indefinitely but not advertised or supported if they break.
472
473         -eof, -timeout in interact (reason: didn't match expect.
474                 Instead, use eof or timeout.)
475
476         -- in expect or interact (reason: no easier to read.
477                 Instead, use -gl in expect or -ex in interact.)
478
479         continue -expect (reason: when mixing in extensions, you have
480                 to use exp_continue, so -expect becomes irrelevant.
481                 Instead, use exp_continue.)
482
483         getpid (reason: Tcl now supplies same functionality as "pid".
484                 Instead, use pid.)
485
486         expect_version and expect_library (reason: the name implies
487                 they have something to do with the expect command,
488                 which they doesn't.
489                 Instead, use exp_version and exp_library.)
490
491         -timestamp for obtaining tm and ctime in expect and interact
492                 (reason: separate command now exists for this purpose.
493                 Instead, use exp_timestamp.)
494
495         system stty (reason: bad interaction with redirection.
496                 Instead, use stty.)
497
498 -- New examples have been added:
499
500 "dislocate" lets you disconnect and reconnect to processes.
501
502 "tkpasswd" illustrates passwd embedded in a GUI.
503
504 They may not be overwhelmingly useful, but run them once to see what
505 they do.  If you ever need to do anything similar, you can look back
506 at them.
507
508 "tknewsbiff" pops up a window or plays a audio clip when you have
509 unread news.
510
511 -- Changes to the Expect libraries:
512
513 The expect-tcl library (libexpectcl.a) has been integrated with the
514 expect library (libexpect.a).  So references to libexpectcl.a should
515 be removed.
516
517 The Expect C library now supports buffering, multiplexing, null
518 matching, full buffer matching.  Basically, all of the features in
519 Expect are now in the library.
520
521 Buffering and multiplexing has caused the biggest change to the
522 library.  Previously, exp_match contained the entire buffer that
523 matched.  Now exp_match just points to where in the buffer the match
524 started.  exp_buffer points to the beginning of the buffer.
525 Previously, the previous buffer was thrown away at the beginning of
526 each expect function call.  Now, previously unmatched characters are
527 eligible for matching.
528
529 To match on different file descriptors, exp_match, exp_match_end,
530 exp_buffer_end must be restored to their previous values.  Initially,
531 they should be zero.
532
533 The meaning of timeout == 0 in the Expect library has been changed.
534 See the man page for more info.
535
536 ======================================================================
537 ======================================================================
538 This file describes the changes from Expect 3 to Expect 4.
539
540 The improvements that people will find most interesting are:
541
542 1) Expect version 4 is designed to work with Tcl 6.7 and Tk 3.2.
543    (Earlier versions of Expect will not work with Tcl 6.7)
544    Expect can now be layered in with any Tcl program.  
545    Note that in Tk, Expect's send command is called "exp_send".
546    (It used to be called "send_spawn" but this bit the dust.)
547 2) A debugger is provided.
548 3) The interact command has been totally rewritten and supports regular
549    expressions, timeout/eof patterns, and a number of other new things.
550 4) The default behavior of ^C (SIGINT) is exit whether or not you are in
551    a read.
552 5) Expect uses "sane" terminal parameters by default, allowing scripts
553    to work the same whether inside emacs shell mode or not.  (See man
554    page on "spawn" for more info.)
555 6) All the hard parts of the installation process are automated.  This
556    was done primarily by Rob Savoye at Cygnus.  Thank you, Rob!
557 7) It is now possible to buy a support contract for Expect from Cygnus.
558
559 The changes that people will find most annoying are:
560
561 1) send now only sends a single string.  (It used to send any number of
562    strings with spaces jammed in between.)
563 2) getpid was renamed pid.
564 3) interact's -flush was renamed -nobuffer (much more descriptive).
565 4) interact now runs all actions in raw mode unless the flag -reset
566    is used.  -f and -F are ignored.  send automatically understands
567    how to do the right thing.  The most likely thing to watch out for
568    are actions like "exec kill -STOP 0" which almost certainly need
569    the -reset flag.
570 5) argv0 is initialized to script name.  argv no longer contains it.
571    argc is initialized [llength $argv].  This follows new Tcl style.
572
573 All differences are described in the man page.  Some of the less
574 significant differences are described in the HISTORY file.  The
575 debugger is described in a separate document (see the README).
576
577 This version also introduces one incompatibility that may require
578 changes to scripts.  While this may initially annoy you, the final
579 result will simplify the process of writing scripts.  Namely:
580
581 In version 3, the expect command accepted lists of glob-style patterns
582 such as:
583
584         expect "a\ b c" action
585
586 where "a b" or "c" would cause action to be executed.  The problem
587 with this is that the pattern list is hard to write and hard to read.
588 Patterns with control-characters, backslashes and dollar signs were
589 very difficult to deal with.
590
591 Regular-expression patterns provide a much simpler solution.  Via the
592 alternation feature (using a "|") the above pattern can be written as:
593
594         expect -re "a b|c" action
595
596 I was concerned about people having a significant investment in code
597 that depended on the old syntax but responders to a comp.lang.tcl poll
598 about such a change in pattern handling were 100% in favor of it.  (I
599 even proposed hooks for backward compatibility, but there was no
600 interest in it.)
601
602 Fortunately, most simple things will work as before including:
603
604         expect foobar
605         expect {foobar}
606         expect "foobar"
607         expect "foo\ bar"
608
609 However, some things won't work as before.  For example, the following
610 will behave differently - now the braces will be considered as part of
611 the pattern.
612
613         expect "{foo bar}"
614
615 Here are examples of patterns in my own code that I had to change:
616
617         was                             changed to
618         Version 3 pattern list          Version 4 pattern
619
620         {Whois:\ }                      "Whois: "
621         {No\ match}                     "No match"
622         {250*ftp>* 200*ftp>*}           -re "2(5|0)0.*ftp>.*"
623         {{Press Return to continue*}}   "Press Return to continue*"
624         {*\r\n*\\\\\r\n}                "\r\n*\\\r\n"
625
626
627
628 Future Change Alert
629
630 John Ousterhout has pre-announced a future change in Tcl that may
631 affect you.  In particular, backslash sequences other than those
632 explicitly listed in the Tcl documentation will be handled as if the
633 backslash was not present.
634
635 The likely place this arises is when quoting characters that are
636 special to the pattern matcher but not to Tcl.
637
638 For example in Tcl 6.7, the following command matches a period.
639
640         expect -re "\."
641
642 In Tcl 7.0, it will match any character, because Tcl will throw away
643 the backslash.  If you want to match a period, you will have to say:
644
645         expect -re "\\."
646 or
647         expect -re {\.}
648
649 The following command will find occurrences of this.  (It may find
650 other things, but it will at least find the problem cases.)
651
652         egrep '(\\$)|(\\[^][bfnrtv\0-9{}$ ;"])' *.exp
653
654 ======================================================================
655 ======================================================================
656 This section describes the changes from Expect 2 to Expect 3.
657
658 If you used to use Expect version 2 (any version written before
659 September '91) you will find that the current version of Expect (3)
660 introduced minor but significant incompatibilities.
661
662 The HISTORY file describes these briefly.  They are described at
663 length in the man page.
664
665 I'm sorry if you feel annoyed at the incompatibilities, but Expect has
666 been out for a year and a half, Tcl even longer.  Both Tcl and Expect
667 are using this as a last chance to make significant changes, so that
668 we will not disturb even more users in the future.
669
670 There is no automated conversion procedure (although see note below)
671 for Expect or even raw Tcl.  For now, I suggest that you not bother
672 fixing things that already work - just keep the old Expect around.
673 The binary isn't very big after all.  If you do write a translation
674 script, let me know.  Thanks.
675
676 Of course, I felt obligated to convert the examples distributed with
677 expect.  I did this by hand while writing the new version itself,
678 partly as an aid but mostly to test lots of variations.  In 90% of the
679 scripts, all I had to do was change:
680
681 (changes due to Tcl)
682         'index' to 'lindex'
683         'range' to 'lrange'
684         'length' to 'llength'
685         'print' to 'send_user' or 'puts' depending on how you use it
686         'function .... c' with '[join [function [split string ""]] ""]'
687 (changes due to Expect)
688         'expect_match' to 'expect_out(buffer)'
689         'set match_max' to 'match_max' (perhaps with -d flag)
690         '*' to '-re .+'
691
692 If anyone wants to write a script to do this, note the pitfalls:
693
694 1) functions and variables do not share the same namespace, so it is a
695 inappropriate to just globally rename things.
696
697 A number of optimizations can be made:
698
699 1) If you are doing multiple split/joins, you should probably cache the
700 split string.
701
702 2) Virtually all uses of scan are unnecessary now, due to exec's automatic
703 stripping of terminating newlines, and expect's support of regexps.
704
705 3) String manipulation can be reduced or avoided entirely if you use
706 expect -re.
707
708 4) exec is no longer necessary to retrieve environment variables, since
709 they can now be retrieved from $env.
710
711 5) If you have been really careful about testing for timeout and eof,
712 you can dramatically reduce the size of your scripts by using
713 expect_before and expect_after.  This is more efficient, as well,
714 since those actions are only parsed once.
715