Do you think you've discovered an error in this book?
Please check the list of errata below to see if we've already addressed the error. If not,
please submit the error via our
Errata Form.
We will attempt to verify your error; if you're right, we will post a correction below.

CURRENTLY SAYS:
"This is expressed as +(a-z). You can also use [:alpha:] in place of (a-z) so this example uses both.

SHOULD SAY:
"This is expressed as +([a-z]). You can also use ([:alpha:]) in place of (a-z) so this example uses both.

10/09/2013

5

95

Text correction: Error in code under "File Comparison Tests"The second to last line of code on the page, Files file1 and file4 differ should be deleted.

2/7/14

7

157

Text correction: Error in code under "Indirection"In the first line of code, "mything" should read "myvar"

2/7/14

8

194

Text correction: Error under "GETOPTS"In the first paragraph, starting with the third sentence:
"getopts displays the error message "option requires an argument -- i" but continues executing. The usage message is displayed when the script later checks if $# is equal to 2, which in this case is not true"

should read:

"getopts displays the error message "option requires an argument -- i" but continues executing with argv set to "?" which causes the usage() function to be called. usage() displays a message and exits the script. The usage message would have been displayed anyway, when the script later checks if $# is equal to 2, which in this case is not true."

4/16/14

9

215

Text correction: Error under "Deleting from an Array"The first paagraph on the page:
"Using unset activities[7] has largely the same effect. As discussed in Chapter 7, there is a difference between setting a variable to the empty string and unsetting it entirely, but it is obvious only when the ${variable+string} or ${variable?string} forms are used."

Should read:

"Using unset activities[7] has largely the same effect. As discussed in Chapter 7, there is a difference between setting a variable to the empty string and unsetting it entirely, but it is obvious only when the ${variable+string} or ${variable?string} forms are used. In the case of an array, it also has the effect of decrementing the size of ${#activities[@]}."

The first set of output on the page should not include the line "Activity 11: parachuting"

Text Correction: Error in CodeCurrently reads:
(The if statement would more commonly be written the other way
around, if [ ?$#? -ne ?2? ] rather than if [?$#? -ne ?2? ], but this is hopefully more clear
for this example.)
this should read:
(The if statement would more commonly be written the other way
around, if [ ?$#? -ne ?2? ] rather than if [ ?$#? -eq ?2? ], but this is hopefully more clear
for this example.)