Nixers Book Club - Book #1: The UNIX Programming Environment - Community & Forums Related Discussions

Users browsing this thread: 1 Guest(s)
seninha
Long time nixers
It's time to bump this thread.

How was your week? Have you have a good reading?

Well, here is my review.

The first two chapters introduces most of what we nixers already know.
But it introduces a 80's UNIX system, the modern systems are somewhat different from the ones at that time

It cites a lot of commands that are not commonly used nowadays, or that have no current relative, or that I simply didn't know they exist, like pr(1), news(1), talk(1), calendar(1), and units(1), a unit conversion program.
I was introduced to most of them while I was reading.

I think the book uses a good path of topic introduction.

The book explains why octal dump was chosen rather than hex dump for the default notation for binary files.
That's why the default binary dump utility, od(1), dumps in octal.
But modern systems have hexdump(1), which I think is better than od(1).

Quote:[...] the emphasis on octal numbers is a holdover from the PDP-11, for which octal was the preferred notation. Hexadecimal is better suited for other machines; the -x option tells od(1) to print in hex.

Other thing I know because of the book is that ^D (ctrl-d) does not send or signal EOF, it's the lack of input that "signals" a end of file.
So, for example, programs that read from /dev/null get EOF immediatelly, because reads from /dev/null always return zero bytes.
Instead, ^D immediately sends the characters typed to the program that is reading from stdin.
If I typed nothing, it ends the input. So I can type ^D in the middle of an input line for cat(1), and cat(1) will immediately print the line:

Code:
$ cat -u
123^D123

One of the differences from old UNIX and modern UNIX is that you can no longer open(2) or read(2) a directory.
For example, the book opens a directory with od(1) to see its contents.
This is no longer possible in modern systems.

One thing I didn't know is that anyone can write on your terminal (check out the permissions for /dev/pts/0). But only the owner can read from it.
Thus, other can send you messages with talk(1) and write(1).
To prevent this, you could chmod the device, or use mesg(1).

Other thing the book explains is the choice of not having file formats as a system feature.
The format of a file depends only on how the programs interpret it.

Quote:No structure is imposed on a file by the system, and no meaning is attached to its contents (the meaning of the bytes depends only on the programs that interprets the file).

At the end of each chapter there's a list of bibliographical references.
I still have to check the bibliography cited at the end of the chapters.


Messages In This Thread
RE: Nixers Book Club - Book #1: The UNIX Programming Environment - by seninha - 21-11-2020, 11:00 AM