Errata

UNIX in a Nutshell

Errata for UNIX in a Nutshell

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 2-105
or just where you give tar examples, the

example tar cvf - `find . -print` > backup.tar does not work properly. The
find command gives you double the number of files. So if you had a
directory and file structure like this:

test_directoryfile1.dat
est_directory2file2.dat

You would get two of file1.dat and two of file2.dat in your archive.

Anonymous   
Printed Page 30
Top

The functionality of SETUID, SETGID, and the sticky bit on directories is not
mentioned. (Nor can I find a concise description anywhere).
I have spent lots of time trying to get the authoritative answer - it would
help if it was in THE authoritative book...

Anonymous   
Printed Page 262
the 3rd line from the bottom

Error is found below:
"The character folloeing a is taken literally. Use within "" to escape ", $, `, and newline......"

Actually, ", $, ` all cannot be escaped by within "".
This is csh, not B-shell.

Anonymous   
Printed Page 359
First example of s command in sed

The example substitution of lines matching the string "function" is not
correct. The comment indicates that the third and fourth " will be
replaced by ( and ), respectively. But, because the third " is replaced by
a ( before the test for the 4th ", this isn't what happens.

For example:
"This is" a "function"
becomes:
"This is" a (function"
While:
"This is" a "function", see?"
becomes"
"This is" a (function", see?)

The example should look like this:
# Change third and fourth quote to ( and ):
/function/{
s/"/(/3
s/"/)/3
}

Anonymous   
Printed Page 359
Your book states

Examples
Here are some short, commented scripts:
# Change third and fourth quote to ( and ):
/function/{
s/"/(/3
s/"/)/4
}

In my opinion, this example does not work in the Linux Bash shell or the
UNIX Korn shell.

As stated correctly in your book, once the 'pattern space' has been changed,
all subsequent editing commands operate on the new version of the 'pattern
space'. Therefor, if you change the 3rd occurrence of an expression and then
attempt to change the 4th occurrence of it, the 4th occurrence is now
effectively the 3rd occurrence.

There are 2 ways around this:
1)
=20
/function/{
s/"/(/4
s/"/)/3
}

(i.e. change the highest occurrence first, so that the absolute reference
to the preceding occurrence has not yet been changed and therefor will
actually be found in the next pass over the line by the editor.)

2)

/function/{
s/"/(/3
s/"/)/3
}

(i.e. in this case the third occurrence has been changed so that now the
4th occurrence is really the 3rd occurrence in the newly changed line).

Both methods 1) and 2) mentioned above will work in both the LINUX Bash
shell and the UNIX Korn shell but the example as stated in the book
does not work in either.

Anonymous   
Printed Page 491
line 9

Remove the "s." from the sccs command

admin -ich01 s.ch01

sccs does the "s." automatically (at least in Solaris 9/build 23a). The
command as currently listed creates SCCS/s.s.ch01

Anonymous   
Printed Page 553
2nd entry

newgrp is listed as an obsolete command, but I think that there is a very
valid case for its use.

Although a user can belong to multiple groups, the group owner of a file
will be their default group - unless they use "newgrp" to select a
different group of which they are a member.

This is extremely useful, in concert with "umask", in setting permissions
within an application environment. For instance, a user may be a member of
the "staff", "prod", and "test" groups, with "staff" being the default.
Although she would be able to access the files in the "prod" environment
(owned by prod, umask/permissions 660), files she creates would be
accesible to "staff" group members, but not to members of "prod" who are
not also members of "staff".

(Additionally the AIX (and other, as I recall) man page on newgrp reports
that it may not be used within a script. This is not entirely true - it
works fine as the last command in a shell script.)

Please, if there is a better, simple way of handling this, enlighten me!

Anonymous