Hacker Humor: More
UN*X History
The different versions of the UN*X brand operating system
are numbered in a logical sequence: 5, 6, 7, 2, 2.9, 3, 4.0,
III, 4.1, V, 4.2, V.2, and 4.3.
The C programming language is descended from the languages
B and BCPL (short for Bucephalus, Alexander the Great's horse).
It is a highly structured language. The following structured
program, for example, is well-known to all C language programmers,
and prints a well-known message at the terminal (try it!):
#define TWENTYNINE 29
int ll, L1, l0, h_1,q,h1,h;
main(){
for(putchar(putchar((h=7)*10+2)+TWENTYNINE);
l0?putchar(l0):!h_1;
putchar (ll),L1==2?ll=' ':0){
L1++==0?(ll=l0=54<<1):
ll=='l'&&L1<3?(ll+=1L|
1L<<1L,l0=0)
:L1==sizeof L1&&ll==' '
?(ll=19+h1):(q-=h1);
L1==5?ll-=8:q&& &
h_1;L1==sizeof ll+2?
(ll+=3):1L;ll==(h<<4)+2
&&L1!=6?(ll=ll-
6):(h1=100L);L1!=1L<<3?q--
:(h_1=ll=h1);
}
printf("%s\n",0);
}
Note the absence of goto statements in the program. Also note
how the portability of the program is enhanced by judicious use
of the C preprocessor and the sizeof operator. The dereferenced
null pointer at the end is used to make sure the output is properly
terminated.
The most commonly used UN*X interactive command language is
known as the Bourne shell. (This shell was recently completely
rewritten and is now available as the Bourne-again shell.) The
shell provides a uniform syntax by which the user can interact
with the operating system kernel and utility programs. The utility
programs in turn accept a uniform syntax of command line arguments
and options. Typical examples of utilities are the ar utility,
which requires single-letter options that are lumped together
in a specified order with an introductory minus sign, before
the other arguments; and the find utility, which has multiletter
options that cannot be lumped together, each of which must be
preceded by a minus sign and which follow any other arguments.
Besides being used interactively, the shell itself may be
used as a programming language. Although programs written in
shell are slower than equivalent programs written in C, they
are shorter and easier to read and debug. For example, to add
1 to a variable a in C one would have to write:
a = a + 1;
or:
a += 1;
or even:
a++;
In shell, one need only write:
a = `expr $a + 1`
where it is essential to have spaces around the + sign to
use the $ sign only before the righthand occurrence of the variable
a, and to use the backward quote character instead of the common
single quote. When UN*X brand operating system programmers want
to develop an application quickly, they often use the shell because
of this convenient syntax.
More Unix history --->>