Unix Power Tools, 3rd Edition by Shelley Powers, Jerry Peek, Tim O'Reilly, Mike Loukides, et. al. This errata page lists errors outstanding in the most recent printing. If you have technical questions or error reports, you can send them to booktech@oreilly.com. Please specify the printing date of your copy. This page was updated March 22, 2007. Here's a key to the markup: [page-number]: serious technical mistake {page-number}: minor technical mistake : important language/formatting problem (page-number): language change or minor formatting problem ?page-number?: reader question or request for clarification Confirmed errors: <253> At top of page: The book refers to rcsgrep, rcsegrep, and rcsfgrep, but it doesn't have a globe icon to point readers to the archive. So this needs a globe icon. (404) Fourth paragraph of section 21.11, last sentence; "To change all the files in the current directory to uppercase, try this..." should be: "To change all the files in the current directory to lowercase, try this..." [422-429] All through the section; The obsolete syntax +POS1 -POS2 that's used throughout the chapter isn't supported by some versions of "sort" anymore. The chapter should be revised to use the -k option. Also, the chapter doesn't cover the effect of the locale on collation. For instance, in the "old way" (ASCII collation), upper- and lower-case letters sort separately. Now -- in en_US or ISO-8859-1, at least -- upper- and lower-case sort together. For example: Original file: Baby Apple baby apple Old sort order: Apple Baby apple baby New sort order: apple Apple baby Baby (BTW, I'm one of the book's authors [Jerry Peek].) {427} Section 22.6, 2nd bullet, 2nd sentence; "...if the sort fields (22.2) you've selected match." should be: "...if the sort fields (22.2) you've selected don't match." (435) First sentence; "...Unix is a mutliprocessing system." should be: "...Unix is a multiprocessing system." (437) Section 23.2, 1st paragraph, last sentence; "This article tries to give you some background into, er, background processes." should be: "This article tries to give you some background on, er, background processes." (464) 1st paragraph; ststistics should be statistics (530) In Figure 27-1, the copyright sym- bols should be single straight quotes. (See that same figure in the second edition.) (670-671) bottom of 670, top of 671; Here are some general notes about runsed and about sed in general. These should be mentioned either here or maybe in an earlier article like 32.2. One advantage of editing with runsed, vs. writing a script for a scriptable editors like ed and ex, is that there's no length limit to the file. If you want to edit a 3-terabyte text file, you can! (runsed assumes that the filesystem has enough free space, though. If it doesn't, you'll need to hack runsed to put its temporary file in another filesystem.) Also, here's a new checksed. It accepts command-line options like -u, which it passes to diff; this is handy if you want to use a "context diff", to control the number of lines of context you see, and so on. This checksed doesn't have the simplicity of the original version, so maybe it should be added as a supplemental version. #! /bin/sh # $Id: checksed,v 1.2 2004/03/13 17:34:18 jpeek Exp $ # # checksed - run 'sed -f sedscr' on a file and show diff of what it would do diffopts= script=sedscr # Loop through command-line arguments. # Print header before each file's results. # Then run sed and show the changes script would make. # Pipe the output of all commands to a pager (default: less). for arg do # Grab any options for "diff". BUG: Doesn't handle option # arguments like "-C 1". Option and argument can't have # space between. You can use long options, though, like # --context=2. case "$arg" in -*) diffopts="$diffopts $arg"; continue ;; esac echo "********** < = $arg > = sed output **********" sed -f $script "$arg" | diff $diffopts "$arg" - done | ${PAGER-less} (677) code example at top of page; On the 6th line of the sed script, an escaped slash(\/) is missing inside the closing HTML tag. It should be: s/$/<\/h1>\ (713) Code snippet at bottom of page, 1st and 2nd lines; 1st line: "+case" should be "case" 2nd line: "vt100" should be "vt100)" (717) First code snippet, 1st line; "+if" should be "if" (732 Footnote text on page 733 is and 733 ) referenced on page 732 {751} 2nd example; From author: If space allows, replace current code with the following: while read line ; do eval $line mail -s "$s" $u < $f done <<"EOF" u=donna f=file23 s='a memo' u=steve f=file34 s=report u=ellie f=file16 s='your files' EOF *If you are able to use this for the reprint, please add Stephen Samuel to the Acknowledgments. [780] Paragraph after example starting "% cat bin/okeeffe"; This sentence is incorrect: The construct ${1+"$@"} means ``expand $1, but if $1 is not defined, use "$@" instead.'' The problem is the word "not", which was added in the third edition. The version on p. 900 of the second edition was correct: The construct ${1+"$@"} means ``expand $1, but if $1 is defined, use "$@" instead.'' In other words, if $1 is defined, then there is at least one command-line argument, so use a quoted list of all command-line arguments. Otherwise, use nothing. (847) first (regular) paragraph, first line; "You may have notice that..." should be: "You may have noticed that..." {850} Line of code just above 2nd paragraph from bottom; ... $birthday{'jay'} ... should be: ... $birthdays{'jay'} ... (851) 1st line; "Example 41-7. Interating over a hash" ^ should be: "Example 41-7. Iterating over a hash" (852) First line of third paragraph; "There are two ways of deferencing..." should be: "There are two ways of dereferencing..." (1075) bottom of left column; There are two entries for the "less" pager: "less command" and "less program". They should be combined. (1115) entries for "zless" should be deleted.