Textbook
Errata

Sat Nov 16 2002, 01:45PM  

This page contains corrections to the text book(s). The errata below describes the page of the error, and either the paragraph number, or line number containing the error. Negative lines numbers count from the bottom of the page. Blank lines are not counted. As you find additional errors or omissions not listed here, please let me know and I'll add them to the list.

Textbook Errata - The Complete Idiot's Guide to UNIX
Pg 303
Line -8,-10
Table 2.2: the permissions shown for octal 3 and 4 are incorrect. r-- is octal 4 and -wx is octal 3 (2+1), since 4 is read, 2 is write and 1 is execute/examine. (Thanks Stew P.).
Textbook Errata - THINK Unix
Official
Errata

The official errata for the THINK Unix textbook is located at:

http://www.tux.org/~lasser/think-unix/errata.html

Pg 37
Line 9
The tree command has been removed from Solaris. Although it can be useful to new users learning the UNIX command-line interface, it is not particularly useful to experienced UNIX users, and there are better tools available for those using the graphical interface. You might try using ls -R, but of course, it will not generate the hierarchical overview provided by tree.
Pg 67
Line 12,15

The section The Easy Way refers to >&. This is a csh mechanism for merging STDERR with the redirected STDOUT; it is not generally valid in sh-based shells (note: the bash shell does support this csh-style syntax). To test out the examples, start a csh or bash shell and try the problem as is:

$ csh

% find / -name '*' -print >& ~/allfiles.txt

or for all sh type shells use:

$ find / -name '*' -print > ~/allfiles.txt 2>&1

Pg 67
Line 25

The ^ username should be ^username, with no space between the ^ and the word username.

Pg 67
Line -9

Same error as on page 67: The ^ username should be ^username.

Pg 143
Line 3

Again, the >& merge syntax is the csh-style syntax. The 2>&1 syntax is available for all sh type shells.

Pg 145
Line 18-22

The statement about signal 9: "It's much harder for a process to avoid being terminated with this signal" might be considered a bit misleading. In fact, it is impossible for a process to avoid being terminated with signal 9. The kernel does not deliver this signal to the process; instead it terminates the process directly and immediately*. Remember signal 9 cannot be caught or blocked by a process.

*In rare cases (typically only with poorly written device drivers and malfunctioning hardware), the kernel will not be able to kill the process if the process is sleeping waiting for an I/O completion event that might never occur.

Pg 145
Line 18-22

For problems 6 through 9, the rev and tac programs are open source GNU programs, and may not be included in your UNIX distribution. They are not part of Solaris, for example. Use the cat program for these practice problems instead.

Pg 246
Line 3

The answer to problem 5 is incorrect. It should be:

telephone [-h|-s] [[1[-]]NNN[-]]NNN[-]NNNN

Note the movement of the brace before the country code 1 in the phone number.

Pg 247
Line 2

The answer to problem 21 has a mistake. Permissions on one hard link do affect permissions on other hard links.

Pg 248
Line 18

The answer to problem 4 for chapter 5 has a mistake. The map should not include the w to write out the file. The correct mapping should be:

:map! <F7> ^[:q!

Additionally, the problem did ask that you create an additional mapping, so the answer should not have used the F7 function key again, since it was already mapped in the previous problem. (Thanks Connie N. for this correction, and for the following two corrections).

Pg 248
Line 24

The answer to problem 8 for chapter 5 also has a mistake. The answer is clearly confusing the meaning of the . and the ? characters in REs (these solutions certainly were not tested!). The ? character does not mean match any character in REs (as it does in shell wildcards), but in EREs means 0 or 1 of the previous atom. The correct solution should be:

grep 'n.t'

Pg 248
Line 25

The answer to problem 9 for chapter 5 is completely incorrect. First, as in the previous errata entry for problem 8, a . needs to replace the ? as the match single character meta-character. Second, the solution is implying that the syntax [ ^] will match either the space character or the beginning of the line and that [ $] will match the space character or the end of the line, thus designating a word. This is incorrect, and does not work. A ^ or a $ inside of the range brackets has no special meaning (except when ^ is used as the initial character to mean not in the range). To match a word, you must use \<word\>. Finally, the problem required a letter as the second character, not any character as the solution seems to allow. The correct solution would be:

grep \<n[a-zA-Z]t\>.

Pg 248
Line -6

The answer to problem 12 for chapter 5 uses the i flag for the substitution. This flag is supported on the GNU version of sed which the author uses, but is not supported on the Solaris version of sed. Sun has traditionally not advanced their basic UNIX toolset to keep up with the industry. The correct Solaris implementation would be:

sed 's/[Yy][Ee][Ss]/no/g'

This of course does not preserve the original case of the "yes", since it forces a replacement to the lowercase "no". (Challenge - can you preserve the case?).

Pg 248
Line -4

The answer to problem 14 for chapter 5 would replace the last occurrence, not the second occurrence as required. In fact, the answer is much simpler than that shown in the book:

sed 's/No/Yes/2'