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

Users browsing this thread: 1 Guest(s)
venam
Administrators
I'll give my personal overall perception of the first 2 chapters.

It has a very light tone, the book is really focused on education and practicality. The writing is neither overwhelming nor condescending, it takes no assumptions

Chapter 1 is sprinkled with a lot of trivia about how to set the terminal machine. From echo and non-echo, to control characters (see man 7 ascii) and what they do, how to configure the terminal properly (like for the TAB, the DELETE/RUBOUT, how to change @ at-sign and # sharp sign for kill and erase), syncing the baud rate, how to pause and continue the stream (ctrl-s ctrl-q), the break key, and much more.

After reading chapter 1 you are left with a deep sense of how much the system was truly multi-user, that it's where Unix shines, this feeling stays true throughout chapter 2.

You can really picture yourself on that system, mainly editing some book or paper, and everyone sharing the machine, having fun "outside of normal working hours" on /usr/games, talking from time to time using talkie-walkie system of over-and-out using write(1), trying to keep your "privacy" at the same time, customizing your personalized environment — your shell.
If you were new you could use the learn command for computer-aided instruction.

Then it dives into some command line tools, especially common text editing ones.
  • wc
  • grep
  • sort
  • tail
  • cmp
  • diff

The author comments about ls uniformity


Quote:The situation is improving

Nope... it hasn't improved...

Also about directories and `pwd`
Quote:great directories have lesser directories...

Also, for cat-v people, the authors clearly tutor users to use cat to print the content of file.

Unlike today:
File name was still limited to 14 characters.
`/usr` was the directory that contains normal users of the system, unlike today.

I like the way pipes are described as removing intermediary files.


Chapter 2 of the book has more of a comparative tone to it, it focuses on the filesystem and how it differs from other systems of the time.

It obviously has to start with the "everything is a file" explanation, and how these files contain bytes, how there's a single file type, and their filenames have no particular meaning but to the program reading them, but the file meaning could be deduced from magic number (file(1)).

It also offers an explanation for the octal representation of some values due to it being the preferred notation of the PDP-11, which might have justified a few historical choices.

Additionally, it has to explain the newline system, referring to how CR and LF would act on a physical terminal. Unix has no records, no count, no special code for end-of-file.

cat today doesn't have the `-u` unbuffered flag anymore.

There's a lot of reference to disk blocks as a counting mechanism for how much is left on the system. Today that's still more or less valid but with SSD and NVMe not so much.
The du and df commands, for example would list the number of disk blocks, each of them being 512 or 1024.


Interestingly, (or not so much), directories were also special files that could be read, but not written to. They had a specific binary format.

After that there's a section about permission and security, how they affect differently files and directories, introducing the super-user (root), how to encrypt file, the specific files containing accounts and passwords /etc/passwd, and the set-uid big (patented by Dennis Ritchie apparently).

Obviously, removing the "search" permission on /usr/games to turn it off during busy hours.

With that, it moves to explain inodes, information node, with all the different date metdata associated with a file.
  • time written/last modified
  • time last used (read/executed)
  • time inode itself was changed

And how internally the system knows how to access files from inode, and how it explains the linking mechanism, if no inodes link to a file then this file is shredded.

The file hierarchy of the system was much simpler than today.

One thing that caught my attention was how the mount program was under /etc and not /bin.


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