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

Users browsing this thread: 1 Guest(s)
Long time nixers
(21-11-2020, 11:33 AM)venam Wrote: If you were new you could use the learn command for computer-aided instruction.
That is something I found amazing, and that unfortunately we haven't anymore on UNIX systems.
But since modern systems are very different from one another, there wouldn't be a single standard learn(1) utility.
An interactive learn(1)-like utility would be great to have.

(21-11-2020, 11:33 AM)venam Wrote: 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.
I couldn't find why octal was preferred on PDP-11.
I know that octal is useful for dealing with characters (especially with UTF-8), but I don't know if that was the case for PDP-11.
The POSIX manual for od(1) explains the differences between od(1) implementations and the proposals of changing it. Unfortunately, hexdump(1) (which is way better than od(1), especially with the -C flag) isn't POSIX. It is a BSD extension (but also available on Linux, I think).

(21-11-2020, 11:33 AM)venam Wrote: cat today doesn't have the `-u` unbuffered flag anymore.
OpenBSD's has. But -u is silently ignored in other coreutils implementations.

(21-11-2020, 11:33 AM)venam Wrote: The du and df commands, for example would list the number of disk blocks, each of them being 512 or 1024.
That is still valid on OpenBSD. It uses the environment variable BLOCKSIZE to specify the size of a block.

(21-11-2020, 11:33 AM)venam Wrote: Interestingly, (or not so much), directories were also special files that could be read, but not written to. They had a specific binary format.
In later chapters we will open(2) and read(2) from directories, the reader needs to adapt the code to modern systems.

(21-11-2020, 11:40 AM)s0kx Wrote: Funny how some commands such as ls(1) and cat(1) are just as popular these days, while others are rarely seen eg. mail(1), news(1) and write(1).
I'm thinking on replacing mutt(1) with mail(1)/mailx(1), but i don't really like the ed(1) interface of those utilities.
I have news(1) from plan9port, apparently those utilities have survived into plan 9.
I haven't used it though.

(21-11-2020, 11:40 AM)s0kx Wrote: ls(1) used to output just a single column of text, why was that changed?
And still output just a single column when the output isn't a terminal.
$ ls
$ ls | cat
I don't know why modern ls(1) behaves like this.
For comparison, plan 9 has two different file-listing utilities: lc(1) that list in columns, and ls(1) which lists in a single column.
I adopted the plan 9 way and I aliased ls to 'ls -1' and lc to 'ls -C'.

(21-11-2020, 11:42 AM)vain Wrote: Funny, we’ll soon be making this same remark, now that files are no longer really visible on mobile devices. Imagine future kids, who grew up with nothing but a tablet, rediscovering the concept of a file.
Yeah, folders, hierarchical file systems and files will be something strange for future kids.
The first time I read the book I found funny the authors having to explain what a file is.

(21-11-2020, 11:42 AM)vain Wrote: Home directories and special directories thrown together? How odd.
Yeah, I also find this odd.
And this still occurs: my system also uses /home/ to place non-user stuff (the directory where the system upgrade is downloaded to).

(21-11-2020, 11:42 AM)vain Wrote: That’s remarkably confusing. When I first read that, I thought --x means you can only list directory contents (so you can search for a given file), but not the file contents. The opposite is true and the following sentences clarify it.
Until just recently I thought that you could access a file from a directory you have --x permission given that you have the full path of it.

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