Yeah, of course. But why is this video claiming they are Unix commands when they are not? Are these just little shell scripts designed for the camera?
Re:The Unix Operating System (1982) [video]
by deviantfero on Sunday May 31, 2020 @03:58AM
(#23368008)
Kernighan is good at explaining things, so I'm guessing he wanted to make it as simple as posible, some of those just don't roll of your tongue as well as the aliased versions
Re:The Unix Operating System (1982) [video]
by sergeykish on Sunday May 31, 2020 @04:38AM
(#23368140)
> existing UNIX programs (on your machine).
They emphasize that users build their own vocabulary. And it is quite possible these command were shared inside AT&T.
Re:The Unix Operating System (1982) [video]
by LeoPanthera on Sunday May 31, 2020 @02:15AM
(#23367616)
Maybe the idea is that every shell script compromised of existing, simpler commands, is automatically itself a "command" in UNIX. Obvious and simple today, but not a common concept when this video was made.
Re:The Unix Operating System (1982) [video]
by TomMarius on Sunday May 31, 2020 @05:21AM
(#23368305)
Wasn't that the same in operating systems like MS-DOS and its predecessors, and on Apple computers as well?
Re:The Unix Operating System (1982) [video]
by nineteen999 on Sunday May 31, 2020 @05:46AM
(#23368391)
Well yeah I guess if you are thinking in terms of batch scripts, but DOS didn't exist until 1980, and UNIX had already been doing this within a multiuser, multitasking environment since at least 1972.
Re:The Unix Operating System (1982) [video]
by TomMarius on Sunday May 31, 2020 @05:49AM
(#23368403)
Oh, my bad, I confused the decade.
They may be, or not. Long ago grep was composed of an ed script (g/re/p), and a spell checker was trivially done this way over grepping /usr/share/dict/words.
The point is to show pipes to the public so they understand command chaining.
I don't think mismatch was grepping over the dictionary at all. That's too slow. The reason you sort the input text first is because it's reading the input text and the dictionary at the same time, making only a single pass through the dictionary...
unique -> uniq
lowercase is easy, tr a-z A-Z
mismatch -> loop and grep over the wordlist and check if the output on non-zero (no match), print that word. A trivial script. (while read line ; do if (grep -q "$line" /usr/share/dict/words) ; then ... )