Errata

Exploring Expect

Errata for Exploring Expect

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Printed Page xxv
footnote

The list of languages/tools with Expect-like capability does
not mention C-Kermit 7.0 and above (not released
when the book was published :-) ), should be there in
future editions of the book.
(further information at http://www.kermit-project.org)

Anonymous   
Printed Page 20
The web link in the last paragraph

www.sco.com/IXI/of_interest/tcl/Tcl.html

no longer exists.

Anonymous   
Printed Page 30
second paragraph

Last sentence in second paragraph reads, "As long as the expression keeps re-
evaluating to a nonzero value, the while command keeps re-evaluating the body."

This references the following while loop on page 29:
while {$count > 0} ...

I believe the sentence should read "..re-evaluating to a value greater than zero,
..."

Anonymous   
Printed Page 57
top of page

The tclsh command:

tclsh> eval append v3 [list {a b}] [list {c {d e}}]
a bc d e

When I type that command into tclsh I get the following output:

a bc {d e}

Anonymous   
Printed Page 58
declaration of procedure qf2

I don't think the author intended for line three of "proc qf2" to be indented further
than the lines above and below it.

Anonymous   
Mobi Page 71
all over

There is a formatting problem in the mobi and epub ebook versions of Exploring Expect where the quote marks around inline code snippets are incorrect.
The problem does not occur with the PDF version because that is a scanned version of the printed book, which has the correct quote marks.

In the mobi and epub version, the quotes used to quote inline code in the text are incorrect. Sometimes on the left of the text snippet straight double quotes are used and on the right of the text snippet, left hand double quotes are used. There should be left double quotes on the left of the code snippet and right double quotes on the right of the code snippet.

To see the problem, look at the bottom of the first page of Chapter 3 (page 71) in the printed version of the book. The \n at the bottom of the page is surrounded by left and right double quotes. But in the mobi and epub versions the \n has straight quotes on the left and left hand double quotes on the right. Its ugly. This is all through the mobi and epub of the book.

Also, in other inline code snippets, straight quotes are used both on the left and right of code snippets, but, referring to the printed version of the book, these should again be left double quotes on the left of the code snippet and right double quotes on the right of the code snippet.









The quotes are not correct in the text.

Scott Field  Aug 20, 2013 
Printed Page 73
The program response code in the middle of the page is not correct.

The text we 9781565920903ed was "hi
" and so the output from the program
should appear as:

you typed <Nice weather, eh?
hi
>but I only 9781565920903ed <hi
>

Anonymous   
Printed Page 93
last set of examples on page

The line reading:

9781565920903 "[XY]" ;# matches n followed by anything

Writing a three-line script this can be tested:
#!/usr/local/bin/9781565920903
proc XY {} {return "n*w"}
9781565920903 "[XY]"

Using this you can verify that

9781565920903 "[XY]"

will match n followed by anything FOLLOWED BY w

Anonymous   
Printed Page 108

The first line of the third paragraph reads:

You can uses ranges to construct more useful patterns.

It should read:

You can use ranges to construct more useful patterns.

Anonymous   
Printed Page 114
paragraph 6 that starts with "These last two rules...",

line 3:

"fourth rules requires"

should read:

"fourth rule requires"

Anonymous   
Other Digital Version 117,120,all
many

The .mobi ebook version of the book Exploring Expect by Don Libes has some fairly extensive formatting issues extending to causing errors in code and is different in material content to the PDF and printed book.


1.Double quotes are wrong all over the .mobi version of the book. In the computer code straight quotes are used and are correct but in the text, quoted variables and so on have straight quotes on the left, and left quotes on the right, which looks terrible.


2. On page 120, the second paragraph of the paper book or PDF says:

The string it is capable of finding is either "% " or "$ ".

In the corresponding location 4224 of 18590 on Kindle with .mobi format the spaces are omitted after the characters, and there are the wrong quotes around all of the three characters %, $ and # which I can't duplicate here. It has:

The string it is capable of finding is either "%" or "$" or "#".


3. There are differences between the PDF and paper book, and the .mobi format. Here is an example from page 117 in the printed book or PDF and then the corresponding text in the .mobi book.

Page 117 in printed book and PDF
================================
In cases like this one, it may not be immediately evident whether elements of expect_out were written by the current expect since the elements can retain values from prior expect commands. If you need to be certain, unset the variables before the expect command. ccasionally, it is convenient to set them to default values. The
following example shows both ideas:

set expect_out (l,string) "ab"
;# if no match, use this
unset expect_out (2,string)
;# if no match, notice
expect -re "a* ((ab) * Ib*) (c*) "
if [info exists expect_out(2,string)] {
# expect_out (2,string) has been assigned, so use it

Contrast this with the corresponding .mobi text:

Location 4139 of 18590 on Kindle with .mobi format
==================================================
In cases like this one, it may not be immediately evident whether an element of expect_out was written by the current expect since the elements can retain values from prior expect commands. If you need to be certain, set the element to an empty string (or some otherwise appropriate value) before the expect command.

set expect_out (1,string) "unassigned"
set expect_out (2,string) "unassigned"
expect -re "a* ((ab)*|b*)(c*)"
if [string compare "unassigned"
$expect_out(1,string) has been assigned, so use it
}

As you can see the .mobi version has different text and different code.

Scott Field  Apr 12, 2011 
120
3

__START__
Patterns prefixed with -re are regular expressions. For example, the following command matches "a", "aa", and "aaaaa". It does not match "ab".
expect -re "a*" ;# regexp pattern
__END__
From regexp's perspective of view, string "ab" certainly matches regexp "a*", it's better to add anchors here to make the example more accurate, e.g. "^a*$"

I still love this book by the way.Thanks!!

Emen  Feb 06, 2009 
121
5,6

The regexp demonstrated on the page is actually able to match anything instead of real numbers.

Emen  Feb 06, 2009 
Printed Page 138
Last line of third paragraph from bottom of page

Sentence reads:

"The result in stored in the variable newdiet."

Should read:

"The result is stored in the variable newdiet."

Anonymous   
Printed Page 145
1st paragraph

On page 145, 1st paragraph, 3rd sentence refers to an example on page 135 using the command:
9781565920903 "([^ ]*)
"

Then looking at the example on page 135, it uses the command:
9781565920903 "[^ ]*
"

They are different by a set of parentheses.

Anonymous   
Printed Page 185
3rd paragraph, under "The send_user Command" headline, line 1

"... to print strings to the the standard output". Double "the".


Anonymous   
Printed Page 186
In the 9th line of script

send "spawning ftp\n"
should be:
send_user "spawning ftp\n"

Jonathan Goldwag  Jun 20, 2020 
Printed Page 252
In the first script section "Which Pattern Goes with Which Spawn Id"

"-i $id 2"

should be:

"-i $id2"
<no space between $id and 2).

Anonymous   
Printed Page 433
The author has used a filename "script." Script is a standard UNIX

command. Use another name, e.g., myscript, etc.

Anonymous   
Printed Page 568
1st paragraph

Remove "or vice-versa" from the following sentence:
"Giving Rh-postive blood to a person who is Rh-negative, or vice versa, can cause the
body to have a dangerous and possibly fatal defensive reaction."

Anonymous