UNIX Harness Manual [Reposted from FreeBSDCHINA]

xiaoxiao2021-03-06  99

A very interesting book is those who are used to Unix's various accuses of UNIX, destroy, smile and ridicule. It is hated by love. Even if it is a senior joke, it is also very valuable.

Unix hate manual

By Simson Garfinkel, Daniel Weise, Steven Strassmann

Chapter 1 Unix

The first computer virus in the world

"Berkeley's two most famous products are UNIX and LSD (a drug), I think this is not a coincidence."

Virus depends on tiny individuals and powerful adaptability to survive. They are not complicated: they do not provide anything for breathing, metabolism, body activities, only sufficient DNA or RNA for prisoning. For example, pneumonia virus is much smaller than the cells they invaded, but they can produce new variants at each pneumonia, causing countless people to die.

A good virus is characterized by:

* Small

There are not many things doing the virus, so it is not necessary. Some people think that viruses are not organisms, just some destructive acids and proteins.

* Portability

The virus is often varied to attack different cells in different ways. It is said that AIDS is made from the virus of the monkey.

* Resources that exhaustion owners

* Rapid variation

UNIX has all the above advantages. When it is born, small, there are not many functions, lack the functions needed to truly operating the system (such as file mapping, telling IO, robust file system, device lock, reasonable process inter-process), its transplantability is very good . Unix exhausts the host's resources, there is no system administrator's time care, UNIX will continue to panic (PANIC), Core Dump, hang. Unix constantly varies: the same patch works on a version, can't do it on another version.

UNIX is a computer virus with a user interface.

Standardized those inconsistent

-------------------------------------------------- ------------------------------

"The greatness of the standard is that it can have a lot" --- Grace Murray Hopper

Since the Unix 80s began to popularize, UNIX manufacturers have been working hard to standardize UNIX standardization. Sun, IBM, HP and DEC have poured millions of dollars on this difficult problem of their own manufacturing.

Why does UNIX manufacturers don't like UNIX standardization?

Many users have been complex enough UNIX, eventually using Windows because their Unix cannot support the application on the UNIX.

If UNIX is standardized, who will buy Sun's machine?

Title: Chapter 2 Welcome New User

Welcome new users like a left round of the six bullets to play Russian roulette Ken Thompson to design a car. Unlike other cars, it has no speed meter, gasoline gauge, and there is no more than those stupid indicators to discuss drivers. If the driver makes any mistakes, a big "?" Will there be a big "?" On the dashboard. "Experienced drivers," Thompson said, "I should know where it is wrong."

A newbie of a computer system requires a friendly system. At least, a decent system will entertain yourself like this:

Command name with functional logical relationship

Careful handling of dangerous orders

Consistent command behavior and command line parameter analysis

Easy and easy-to-read online documentation

When the command fails, give understandable and useful error feedback

During the construction of UNIX, they never invited their residents. Visiting is a construction worker wearing a hard hat, which is placed in the various corners of this broken wooden house. Unfortunately, not only the participation of the Human Factors engineers, but the needs of the households have never been considered. So the soiletable toilet, central heating, windows, etc. These convenient facilities are hard to add. But architects still proud of UNIX, seems that they don't mind sleeping in a house without a fireworks detector. In most history of its development, UNIX is just a research tool for university and industrial researchers. With a large number of cheap workstations, UNIX has entered a new era as a platform software. This change has occurred approximately in 1990, its mark is that workstation vendors remove C compilers from UNIX release to reduce cost meeting the needs of non-developing users. It can be seen that the Unix manufacturers have begun to consider the needs of non-programmer users in recent years, starting to provide them with a graphical interface other than the shell.

Ambiguous command name

UNIX novices always surprised Unix named commands. Education is not enough to make them understand the simplicity and beauty of both alphabetical orders such as CP, RM, and LS.

People who use the early IO equipment in the 1970s can understand the speed, reliability, and its keyboard of the ASR-33 Teletype. And today, this kind of feedback principle, only need to close a microphone's keyboard, you must use the TELETYPE of the teletype at least half inch to launch a small generator similar to bicycles, and operate the bone in the above Danger of fracture.

If Dennis and Ken use SELECTRIC instead of Teletype, it may be "CP" and "RM" but "Copy" and "Remove" today. (Ken Thompson has been asked if he can redesign Unix he will do what modified, he replied: "I will add an e.") After the CREAT command, "), technology can also limit our choice. Our choice, this example is also.

More than 20 years have passed, what reasons have to continue this tradition? The reason is "the irreplaceable power of history", history is the code and textbooks that exist. If a vendor replaces RM with REMOVE, all UNIX textbooks do not apply to this system, and each shell script that uses RM needs to be modified. And this is not a POSIX standard.

Before an century, the typographic master is often stirred together, and the engineer has designed the QWERTY keyboard, so the problem has been solved because no one can play fast on such a keyboard. The computer's keyboard no longer has a mechanical key handle, but QWERTY's keyboard layout is still in use. Similarly, in the next century, we will continue to use RM.

Accident happens

Users are very concerned about their own data and files. They use computers to generate, analyze, and store important information. They believe that the computer protects their important property. If there is no such trust, they will be shadowed with the relationship between the computer. Unix failed our trust, which refused to protect users using hazardous commands. For example, RM is a dangerous command for deleting files.

All UNIX novices have an unrecoverable deletion of important documents, even an expert and system administrator have encountered. Therefore, the annual loss time, energy can be worth millions of dollars. This is a questionable problem; we don't understand why UNIX has been refused to solve this problem. Does the result is not much tragic?

Unix needs to resume delete functions than other operating systems, because:

Unix file system has no version function

Automatic version maintenance can retain the historical version of the file to prevent the new version from rushing out of the old version.

UNIX programmers are not yet checked in error handling Many programs that do not check if all content is written to disk, or whether the file written is present. Some programs always delete the input file.

UNIX shell extension "*" instead of its subcommand that is the command such as "*" these dangers. Even DOS is also a suggestion for "del *. *". But under UNIX, RM * and RM File1 file2 ... is not distinctive.

Delete is permanent

Unix has no undelete command. Many other safer systems just mark the blocks used by the deleted files for "can be used", then move it to a special directory. If the disk is full, these file blocks will be reused. This technology is not a rocket science, Macintosh proposes the idea of ​​"recycle bin" in 1984, and Tenex used this technology as early as 1974. Even DOS also provides a simple Undelete function, although not always effective.

These four issues cooperate with each other to create an important document that cannot be recovered. The solution has long been present, but the UNIX "Standard" version has never been provided.

Welcome to the future world.

"Rm" is end

Many actual terror stories have described these principles. The following is one of a series of stories circulated on the Alt.Folklore.comPuters News:

Date: WED, 10 JAN 90

X-Virus: 6

From:

Djones@megatest.uucp (Dave Jones)

Subject: rm *

Newsgroups: alt.folklore.computers

Someone wants to perform the following command:

% rm * .o

The result is made:

% rm *> O

Now you get an empty file O, as well as a large space to store it!

In fact, you may not even have O, because the shell's document does not say o is established after the extension is expanded or expanded.

The last book tells how to use RM to get an empty file and a large disk space, the following is another usage:

Date: WED, 10 JAN 90

X-Virus: 6

From:

Ram@attcan.uucp

Subject: RE: RM *

Newsgroups: alt.folklore.computers

I have been I have been in RM. Once I want to delete some / usr / foo / down, I'll take the following command in / usr / foo:

% rm -r./etc

% rm -r ./adm

When I want to delete ./bin directory, I forgot to knock on that point. My system doesn't seem to like this.

When this is hit, UNIX is completely finished. Smart systems will give users a chance (or at least reminding the user to cause system crash).

Unix is ​​ambiguously deleted as an occasional file. For example, you can refer to the FAQ on the Comp.Unix.questions below:

6) How to delete a file?

Maybe one day, you accidentally executed this command:

% rm * .foo

Then I find that you delete "*". You should take this as a class of life.

Of course, a competent system administrator should be scheduled to back up the system. So you'd better ask them in their hands with your file backup.

"One lesson of life"? There is no other manufacturer to treat a defective product in such an attitude. "Adults, I know your fuel tank, but this is a class of life." "Mr. Jury, we will prove the failure of the chainsaw insurance switch is just a class of life on the user." Yes .

Change RM behavior is not a way

After being bitten by the RM, it is often thought of replacing RM with "RM -I", or replaces the RM, put all the deleted files in the ~ / .deleted directory. These tips make users with wrong security.

Date: MON, 16 APR 90 18:46:33 199

X-Virus: 6

From: phil agre

To: UNIX-HATERS

Subject: deletion

On our system, "RM" does not really delete files, but replaces the file, so "undelete" tool can recover the deleted file.

This feature makes me no longer care about the delete file, and I can find it back anyway. However, I am wrong. The deletion in Emacs does not support this feature, and the Dired command is also true. This is of course because file recovery is not a function of the operating system.

So, now I have two concepts in my mind, one is a "deleting" file, one is a "rm'ing" file. When my hand wants my brain to delete a file, I always divide these two concepts again.

Some UNIX experts have made ridiculous conclusions, they think it is best to make RM more friendly. They argue that let UNIX more friendly efforts are often counterproductive. Unfortunately, they are right.

Date: Thu, 11 Jan 90 17:17 CST

X-Virus: 6

From:

Merlyn@iwarp.intel.com (Randal L. Schwartz)

Subject: Don't overload Commands! (Was Re: rm *)

Newsgroups: alt.folklore.computers

Don't let people replace standard commands with the "safety" command.

(1) Many shell programs are surprised by the multi-mouth RM, and they will not think that the deleted file still has disk space.

(2) Not all deleted operations are safe, and some households will generate an illusion that everything can be recovered.

(3) Those unbolded orders are especially hateful for system administrators. If you want to have a "RM" with a confirmation function, use the following command:

% Alias ​​Del RM -I

Don't replace RM!

Recently, there has been a survey of system administrators on Comp.unix.Questions, let them? * 鲎 鲎 南 南 低 低 芾 砉 砉 砉???????? 低 南 南 南 南 南 南 南 植 植 植 植 植 植 植 植 植 芾 植 植 芾 植 植 植 芾 芾 植 植 植 芾 芾 芾 芾 芾 芾 芾 植Many related to the files we described above. It is ridiculous, these can be unix masters. However, they are defending the "Unix is ​​not friendly".

Isn't users are not friendly? Unix is ​​friendly for system administrators? Please see

Date: WED, 14 SEP 88 01:39 EDT

X-Virus: 6

From: matthew p Wiener

TO:

Risks-list@kl.sri.com

Subject: "Single Keystroke"

On UNIX, even if there is an experienced user, RM is also missed. I have never misuse a file, but one day, I use! R Repeat a history command, I am surprised to find that I am running "rm -r *".

Why can't you have a shell without a History function?

I also heard a user attempt to delete a file called "*", so there is no permission.

This user also wants to modify the shell to avoid expanding the *. Unfortunately, this remedy is like a lacquer in the water seepage wall, and the standard is not true.

Online help

The number of users read printing documents is less than they participate in elective votes. Only online documents that can be used is useful. Let's take a look at how UNIX's man is disappointed with the new user that needs it.

Not each command is equal, some are external commands, some are internal commands. Some man Page, some are not. Unix requires you to distinguish these commands. For example, WC, CP, and LS are external commands, which are Man Page, while fg, jobs, set and alias (where are these long file names come from?) Are internal commands, which do not have Man Page. Unix tells the newbush to help with the "man command" command, they don't know that all commands are not all commands. In addition, if their shell sets some inexpensive, they can only ask the masters to get help.

Error message and error check? no way!

Novice is easy to make mistakes, such as using the wrong command, or with the wrong option. The system should be able to identify these errors and feedback to the user. Unfortunately, UNIX programs have never bother themselves. Instead, UNIX often mixes all kinds of errors until a fatal result is created.

In the first section, we explained how RM is easily deleted. But you may not know that you can easily delete files without RM.

Want to delete your files? Try the compiler

Some CC versions often do not consider user possible input errors, and delete some source code files. Some undergraduates often have a way.

Date: Thu, 26 Nov 1992 16:01:55 GMT

X-Virus: 6

From:

Tk@dcs.ed.ac.uk (Tommy Kelly)

Subject: Help!

Newsgroups: cs.questions

Organization: lab for the Foundations of Computer Science, Edinburgh UK

I just want to compile the program:

% cc -o doit dress.c

I accidentally knocked it:

% cc -o doit.c doit

Don't say that my DOIT.C is rushed away. Is there a way to recover my procedure? (I did a whole morning)

Some other programs have the same behavior:

Date: Thu, 1 july 1993 09:10:50 - 0700

X-Virus: 6

From: daniel weise

To: UNIX-HATERS

Subject: tarred and feathered

After several efforts, I finally downloaded a 3.2m file from a fragile FTP site in Europe. This Untar it. I knocked on the command:

% tar -cf hesis.tar

…no respond.

Old days!

Is it necessary to use the X option instead of C?

Yes it is.

TAR is not given an error message saying that there is no input file?

No.

Does TAR feel wrong?

No.

Tar is really not really Tar?

Yes it is.

Does TAR have covered with THESIS.TAR?

Of course, this is UNIX.

Do I still need to spend 30 minutes to download this file from Europe?

Of course, this is UNIX.

I must definitely have a lot of people who have encountered this unfortunate, such as: error message, file version, confirm whether the user wants to overwrite an existing file, and so on. Tar seems to be intentionally giving users trouble.

This bug is more dangerous for system administrators who often backed up with Tar. Many system administrators have used "TAR Xf ..." in the backup script. When you need to restore your backup, I didn't do anything.

If you want to know if there is any other horror command, please follow the decomposition.

The last book tells how cc, tar, etc. helps you delete important files. The power of UNIX is certainly unlimited.

Because there is no error check, in the support of many "Unix Power Programming Tools", users have various options to delete their important files. Date: Sun, 4 OCT 1992 0:21:49 PDT

X-Virus: 6

From: pavel curtis

To: UNIX-HATERS

Subject: So Many Bastards to Choose from ...

I have a program that is running, used to provide network services, and check the internal state of the system every 24 hours.

One day, I cd to the directory where the Foo is located, because this is not a development directory, I want to see how the foo is version. The code is maintained by RCS, so I naturally use the following command:

% Ident Foo

Don't take the sink of RCS, don't manage the iderter how to be mad. My trouble is, my finger is self-selected, INDENT, INDENT, like a word rather than Ident:

% Indent foo

Indent is a stupid C code style conversion tool for UNIX. Is that written for the independed bastard? Is it true for the input file (How to see if the suffix of the file is .c)? I think you know the answer. Moreover, this SB (SAID BASTARD) thinks if you only give a parameter, then you just want to perform online style conversion. But don't worry, this SB takes into account the trouble that may bring, he saves a backup foo.bak. However, is he just changed the FOO? No, he chose to copy (no doubt, the programmer written in Indent has opened the foo when preparing backup, and the rename system call is later).

Now, you may know what happened ...

My foo is running in the preparation of the page fan, I found that the original executable is not there, this is not a good thing, so my Foo collapsed, I lost 20 hours of system status information.

Naturally, those designed (cough) Unix bastions are not interested in complex file version, and this feature can save my life. Of course, those bastards have never thought of locking files that are preparing to fans out, is it?

There are so many bastards to choose, why not kill them?

Pavel

Imagine a paint that emits chlorine, according to the instructions, it is not a problem in outdoor, but if you use it to brush your bedroom wall, your head is bigger. How long does this paint can survive in the market? Of course, it will not exceed 20 years.

Error information joke

Will you laugh when you see a plate of vegetables in the customer's head? Unix haball. But when the helpless users have to solve the error message, they are the first to laugh.

Some people organize some Unix the most ridiculous error messages and released him on the usenet. They use C shell.

% rm mese-ethics

RM: Messe-Ethics Nonexistent

% AR M god

Ar: god does not exist

% "How Would You Rate Dan Quayle's INCOMPETENCE?

Unmatched ".

% ^ How Did The SEX CHANGE ^ OPERATION Go?

Modifier failed.

% IF I Had A (For Every $ THE CONGRESS SPENT, WHAT WOULD i HAVE?

Too Many ('S

% make love

Make: don't know how to make love. Stop.

% Sleep with Mebad Character

% GOT a LIGHT?

No match

% Man: why did you get a divorce?

MAN :: Too Many Arguments.

% ^ What is saccharine?

Bad substeute.

%% blow

% Blow: No Such Job.

The following humor works from the Bourne Shell:

$ PATH = pretending! / Usr / ucb / which sense

No sense in pretending

$ Drink

Bottle: Cannot Open

Opener: not found

$ mkdir matter; cat> matter

Matter: Cannot Create

UNIX attitude

We show a very bleak picture: the fans and general command names, inconsistencies and unable to expect results, dangerous commands are not protected, unacceptable online documents, as well as a sudden job in error checking and fault tolerance. Those who visit UNIX are not to get warm hospitality, they are not tourists in Disney Park, more like the United Nations peacekeeping force in the implementation of the task. How will UNIX make this look? As we pointed out, some of them were caused by historical reasons. But there are other reasons: that is, Unix culture formed for many years, this culture is called "UNIX philosophy".

Unix philosophy is not a manual from a Bell Lab or UNIX system laboratory. He is naturally formed, which contains many people's contributions. Don Libes and Sandy RESSLER have made good summary of UNIX philosophy in "UNIX Life":

Small is beautiful

Solve 90% of the task with 10% work

If you must make a choice, choose the easiest thing.

According to the practical performance of UNIX programs and tools, the more accurate summary of UNIX philosophy should be:

Small procedures are better than the correct program

Crude abuse is acceptable

If you must make a choice, select the smallest responsibility.

Unix has no philosophy, UNIX is only attitude. This attitude pointed out that simple work is better than complex complete work. This attitude indicates that the programmer is more precious than the user's time, even if the user is much more than the programmer. This attitude indicates that the minimum requirement is sufficient.

Date: Sun, 24 DEC 89 19:01:36 EST

X-Virus: 6

From: david chapman

To: UNIX-HATERS

Subject: Killing Jobs; The Unix Design Paradigm

I have recently learned how to kill the task on UNIX. In this process, I realized a lot of Unix's powerful and wisdom, I would like to share with you.

Most of you don't have UNIX, so you know how UNIX the task is estimated to be used. However, some of you, including me, may often run some TEX tasks, then learn to kill the task is especially important. The "kill" command inherits UNIX design principles, so some of the following experiences have more common sense.

In UNIX you can use ^ z to hang a task, or terminate a task with ^ C. But Latex intercepted ^ c. As a result, I often make a bunch of Latex tasks. I don't care about it, but I still feel that I should find a way to remove them.

Many operating systems have commands such as "kill", Unix is ​​no exception. "Kill" on most operating systems is only used to kill the process. But Unix is ​​more common: "kill" is used to send a signal to the process, which reflects a design principle of UNIX:

Try to make the operation universal, give the user powerful force (Power)

The "kill" command function is very powerful; you can use it to send a variety of signals to the process. For example, 9 this signal is used to kill the process. Note that 9 is the largest one, which reflects another design principle of UNIX: the simplest name that can reflect functionality

On the operating system I know, "KILL" without parameters is used to kill the current task. Single Unix "kill" always requires parameters. This reflects a wise design principle of UNIX:

Try to use long parameters or tips to prevent users from accidentally put themselves (Screwing Himself)

This design principle is reflected in many UNIX applications, I don't want to list them, but I still want to mention the implementation of Logout and file deletion on UNIX, I hope you know what I mean.

On the operating system I know, the parameters accepted by "Kill" are the task name. This is not a good choice, because you may have many Latex tasks run at the same time, and they all have the same task name "Latex". So "Kill -9 Latex" may produce ambiguity.

Like other operating systems, UNIX provides a command "jobs" listing the task. Here is an example:

ZVona @ rice-chex> jobs

[1] - Stopped Latex

[1] - Stopped Latex

[1] Stopped Latex

This allows you to identify a task with a JOB number (indicated in []).

If you are affected by those who have not been carried out, you will want to use "Kill -9 1" to kill the first LATEX task. But you will find the following error message:

ZVona @ rice-chex> kill -9 1

1: Not Owner

The correct approach is to use the process number, such as 18517. You can use the "ps" command to get it. When you find the corresponding process number, you only need:

Zvona @ rice-chex> kill -9 18517

ZVONA @ rice-chex>

[1] Killed Latex

Note that UNIX gives you a prompt before your task is really killed. This reflects a UNIX design principle:

For the feedback to the user, you can say less, you can say that you can say nothing later. Users who may cause too much information may cause brain damage.

I hope that these experience can be useful to everyone. During this study process, I have been deeply attracted by UNIX design philosophy. We should all learn from the elegant, powerful and concise middleness of the UNIX kill command.

The second chapter is over, I have experienced so many difficulties, you are not a newbie, and the next book will introduce the documentation of UNIX, or there is no documentation in Unix.

Title: Chapter III Documentation

OK, not a novice you may want to learn from UNIX. Nice, UNIX documents are what you need.

Documentation

What document

"One advantage of using UNIX operating system teaching is that the student's school bag can install all UNIX source code and documentation."

- John Lion, New South Wales University, in 1976, talking about UNIX version 6 point.

For many years, there have been three simple ways to obtain UNIX related knowledge:

Read source code

Write your own UNIX

Call Unix's programmer (or email)

Like Homer's epic, UNIX is tangled orally. If you don't become a kernel hacker, you can't be a serious UNIX user - or at least there is a tentacker hacker with a tentacker. The existing document - Man Handbook - but some memorandums you have already known for what they are doing. Unix's document is so simple, you can read it in an afternoon.

Online document

The Man Tool is the basis for the UNIX document system. Man accepts the parameters you entered, find the corresponding document file, output it to NROFF (some text format macros) that do not have other places on some places), and final results are sent to PG or more. First, these fragmented documents are called "Man Pages" because these documents are more than one page (most cases are less than one page).

MAN is a good thing for that era, but that era has already returned.

Over the years, MAN systems have developed mature. It is worthy of praise that it doesn't make the code chaotic program like UNIX, but it has not become more useful. In fact, in the past 15 years, UNIX's documentation system has only two improvements:

Programmer "surprise" found that in addition to NROFF format, they can store the handled document file so that the speed of the document is faster. For today's fast processor, Catman doesn't seem to need it.

However, many NROFF processed document files still occupy a few megaby disk space. MakeWhatis, Apropos and Key (finally constituted Man -k function) is a system that indexes to the Manbook, so that even if the exact name of the program can be queried even if you don't know the exact name of the program.

At the same time, the momentum of the electronic publishing has already exceeded the MAN manual. Using today's hypertext system you can use the mouse from an article to another article; Compared with the MAN manual, the "See Also" section is only available at the end, so that the user will be mans themselves. What is the index function of the online document? Today you can buy an Oxford English dictionary on the CD-ROM, which has an index on each of the words; but the Man manual is still indexing the command name and description line. Today, even DOS provides an indexed hypertext document. However, the Man manual is also a format of 80 columns 66 rows suitable for DEC print terminals.

Fair point, some manufacturers can't see it, provide their own hypertext online document system. On these systems, the MAN manual has come to the end of evolution, often not outdated, it does not exist at all.

"I know it is here, but I can't find"

For those who are still using the Manbook today, the biggest problem is to tell MAN's manual you want. It is easy to find the Man's manual: all in / usr / man. Later, the Man Handbook is divided into different directories in chapters: / usr / man / man1, / usr / man / man2, / usr / man / man3, etc. Some systems even put the "local" manual under / usr / man / man1.

When the AT & T release system V, the situation becomes puzzled. The / usr / man / man1 directory becomes / usr / man / c_man, which seems to be better than the number. In some systems, / usr / man / man1 becomes / usr / local / man. Those companies that sell UNIX applications began to build their own Man directory.

Finally, Berkeley modified the Man program to find a series of directories specified in the Environment Variable $ MANPATH. This is a great idea, there is only one small problem: it doesn't work. (I will omit 100 words, because I am too lazy, the content is too late, the man on Linux is still good, in addition to the MAN manual of the shell internal command, of course, Man Bash is a choice - me).

Is this an internal document?

Some big UNIX tools also offer their own documents. Many online documents of the program are "Usage" (usage), which is called. Below is the "use" description of awk:

% awk

awk: usage: awk [-f Source | 'cmds'] [files]

Is it very useful? Complex procedures have a more in-depth online document. Unfortunately, they sometimes don't seem to be a program you are running. Date: 3 Jan 89 16:26:25 EST (Tuesday)

X-Virus: 6

From: reverend heiny

To: UNIX-HATERS

Subject: a conspiracy uncovered (conspiracy is revealed)

After a few hours of concentrational research, I got an important conclusion:

UNIX is a shit (UNIX SUCKS)

Now, you may feel surprised, but this is the fact. This study has been confirmed by researchers throughout the world.

More importantly, this is not just a booth, but a thin and sticky stinky shit, is a big smell. Take a look at this example, you will know:

Toolsun% Mail

Mail Version SMI 4.0 SAT APR 9 01:54:23 PDT 1988 TYPE? For Help

"/ Usr / spool / mail / chris": 3 Messages 3 New

> N 1 Chris Thu Dec 22 15:49 19/643 Editor Saved "Trash1"

N 2 Chris Tue Jan 3 10:35 19/636 Editor Saved "Trash1"

N3 Chris Tue Jan 3 10:35 19/656 Editor Saved "/ TMP / MA9"

&?

Unknown Command: "?"

&

What kind of system environment (especially this guy who can drive, vote, drink beer age) will reject a command it makes it?

Why is the user manual so separated from reality?

Why is these mysterious orders do not match this?

We don't know what heiny's question; like some of the problems mentioned above, this bug seems to have been revised. Or, it is transferred to other programs.

Date: Tuesday, September 29, 1992 7:47 PM

X-Virus: 6

From: Mark Lottor

To: UNIX-HATERS

Subject: No Comments Needed (no need to say)

FS2 # add_client

Usage: add_client [options] Clients

Add_client -i | -p [options] Clients

-i Interactive Mode - Invoke Full-Screen Mode

There are some options, here is omitted]

FS2 # add_client -i

Interactive Mode Uses no Command Line Arguments

How to get a real document

In fact, UNIX's best document is often used in Strings handler binary code. You can get the file name, environment variable, unapproved option, weird error message, and so on all programs. For example, if you want to know how the CPP looks for the header file, you'd better use strings instead of Man:

Next% Man CPP

NO MANUAL Entry for CPP.

Next% strings / lib / cpp | GREP /

/ lib / CPP

/ lib /

/ usr / local / lib /

/ CPP

NEXT%

Um ... don't worry

Next% LS / LIB

CPP * gcrt0.o libssy_s.a

CPP-Precomp * i386 / m68k /

Crt0.o libsys_p.a pOSIXCRT0.Onext% strings / lib / cpp-precomp | grep /

/ *% s * /

//% s

/ usr / local / incrude

/ NextDeveloper / headers

/ NextDeveloper / headers / ANSI

/ NextDeveloper / headers / BSD

/ Localdeveloper / headers

/ Localdeveloper / headers / ANSI

/ LocalDeveloper / headers / BSD

/NEXTDeveloper/2.0CompatibleHeaders

% s /% s

/ lib /% s / SPECS

NEXT%

I am a fool. Nextstep's CPP uses / lib / cpp-precomp. You can't find this in the Man's Manual.

Next% Man CPP-Precomp

No Manual Entry for CPP-Precomp.

OK. What all this is because? Where did this come from? Next decomposition.

The last book is said that the source code is the best and unique document, the root cause is because UNIX is ...

For programmers, not users

Don't blame Ken and Dennis because of the documentation of UNIX. When UNIX just started to establish a document, there is no compliance with the industry popular document standards, some bugs and potential traps, not the functionality of the program, is recorded, because people who read these documents are often UNIX system developers. For many developers, the MAN manual is just a place to collect bug reports. Those ideas that provide documents for primary users, programmers and system administrators are new. Sadly, this concept is not very successful due to the Unix document system established in the 1970s.

The UNIX World recognizes the status quo of these documents, but does not think there is a big deal. "UNIX Life" is objectively explained by UNIX to the document:

UNIX source code is the best document. After all, this is the system used to determine how to run the documentation. Document is used to explain the code, often written in different times, and these people are often not writing code. You should think of these documents as guidelines. Sometimes these documents are just expectations.

However, a more general approach is to find unsourized usage methods and function descriptions in the source code. Sometimes you find that the functions recorded in some documents are not implemented.

This is just for the user program. For the kernel, the situation is even worse. Until recently, there is no documentation for the device driver and internal-core calling functions provided by the manufacturer. Some people joked: "If you feel that you need to read the documentation about the kernel function, you are likely that you don't use these functions."

The truth is probably more evil. The reason why there is no kernel document is because AT & T looks its code as a commercial confidential. If you want to write a book that describes the UNIX kernel, then you will wait for the Sub.

Source code is a document

Life is destined, AT & T's plan is compromised. Due to no documentation, the only way to understand the kernel and applications is to read the source code. As a result, UNIX source code was madly pirated in the initial 20 years. Consultants, programmers and system administrators to engage in unix source code is not to recompile or produce their own UNIX version, they need documents, and source code is the only choice. Unix source code from the university flows to the surrounding high-tech company. This is of course illegal, but there is an enabled: UNIX manufacturers are not enough.

This is not the secret of what is worthy of money in the source code. All people who have read UNIX code were thrive at a rough confirmation:

/ * You are not expected to understand this * / (/ * Didn't expect you to understand * /)

Although this line comment starts to appear in the UNIX V6 core, almost all the original AT & T code is similar, which is full of macros that have been optimized and weird. The register variable is crown with the name of P, PP, and PPP. "This function is recursive" seems to indicate what is difficult to understand. In fact, the attitude of AT & T is good at the document is just a reflection of the hidden attitude of its writing code. To identify a footprint man is actually very simple: you will see the paint on the crack, a patch that picks up one, all things are barely enhanced by tape and chewing gum. It must be recognized: If you want to build and redesign from head, you must think more, and more effort.

Date: Thu, 17 May 90 14:43:28 -0700

X-Virus: 6

From: David Chapman

To: UNIX-HATERS

This is a paragraph in Man Man, very interesting:

Diagnositics

If you use the -m option and give the path do not exist, then the output error message may be a bit wrong. For example, the / usr / foo / directory does not exist if you run:

MAN-M / USR / FOO LS

Then the error message you get is "No Manual Entry for LS" ("Does No LS Manual Record"). Tell your directory / usr / foo when the correct error message does not exist.

There are Kung Fu to write this paragraph, I am afraid enough to modify this BUG.

Silent Unix: Curriculum Settings Suggestions

Date: Fri, 24 Apr 92 12:58:28 Pt

X-Virus: 6

From:

Cj@eno.corp.sgi.com (c j silverio)

Organization: SGI Techpubs

Newsgroups: Talk.bizarre

Subject: UNIX WITHOUT WORDS (no words Unix)

[In a fierce debate about document unused, I proposed the following suggestions. I am small, so I dare to open now for your reference. ]

UNIX OHNE WORTER (no turning - ME)

I was deeply convinced by the document that was walking here. In fact, I am further thinking that the document is drug, I have caused it for its dependence. With the help of a profession, I think I can quit it.

Moreover, my conscience tells me that it is no longer born with this drug. I decided to go back to the math research institute to reborn, completely from this parasitic occupation.

Although the document following this seems to show how deep it is poisoning, but I still think that the next version should be provided to the user. This is just a temporary move, and it will fill it later.

This is my suggestion:

Title: "Silent Unix"

Object: unix newbie

Summary: Provide a general policy that uses UNIX without document conditions. Shows the general principles of any operating system without document conditions.

content:

Introduction: "No Document" Philosophy

Why is the manual is a devil?

Why is the MAN manual is a devil?

Why do you still read this document?

"This will be the last document you read!"

Chapter 1: How to guess what may be present?

Chapter 2: How to guess the command name

Unix's weird thumbnail nomenclature

Case: GREP

Chapter III: How to Guess Command Options

How to crack weird instructions

Case: Tar

How do you know when the order is important?

Case: fine

Chapter 4: How to know the correctness: No news is good news

Restore from errors

Chapter 5: Oral Tradition: Your friend

Chapter 6: How to get and maintain a living UNIX master

How to feed your master

How to make masters happy

Offering all the importance of all newsgroups Why your master needs the fastest computer

Free Can: Master's longevity

How to keep a master health

When do you sleep?

Chapter 7: Common Troubleshoot: Your master ignore you

Identify stupid problems

How to safely put a stupid problem

Chapter 8: How to Belt pressure

How to treat failed

Note: May only have 6, 7 chapters really need. Yes, this is the right road: I call it "Unix Master Domestication Guide".

OK, there is no document. The next book will take you into the beautiful world of Sendmail, why "The feeling of sendmail is the same as the flower willow disease."? Next decomposition.

Title: Chapter 8 CSH, Pipes and Find (Part 1)

The Unix Romance started again. This book will be a table of Sendmail and flower willow disease. We can communicate privately with the history of history and sexual disease struggle.

As a programmer, you may be more interested in the UNIX programming environment, so this section describes the history of UNIX shell. I gpl, you didn't spend money, so I can only let me put, what you eat, don't talk nonsense.

The benefit of GPL is that you don't have to be responsible for your work, you don't have to be responsible for users, so SourseForge is full of tight free projects. I hope that my people can understand this. All the beginning is not for what value, responsibility, the past or the future, all this is not for the present, all this is just from pass.

Each foam spit out in the sea

Each dust inhaled on the workplace

Every pain in the past years

Sleeping and waking up again

In the weather forecast and news broadcast

In July flowing fire and in September

In July Changsheng Temple

In the cornflower and hibiscus

In the long rope day

In a long time

at your side

in my heart

No need to seek significance

Chapter 8 CSH, PIPES and FIND

Powerful tools give strong fools

"Some operating systems have never been planned to plan, so that I have to name it with ruminant noise (awk, grep, fsck, norff), I think this will be nausea."

-- anonymous

The so-called "powerful tool" of UNIX is a scam. This is just that UNIX is a hit of the mosaic for the commandments and tools. The real powerful tool does not require users to pay too much effort to provide powerful features. Anyone who will make the cadre and drill should use electric to modify cone and electric drill. They don't need to understand electrical, motor, torque, electromagnetic, heat dissipation or maintenance. They only need to power it up, bring safety glasses, and turn on the switch. Many people do not have safety glasses. You can't find a deadly defective tool in the Hardware store: They are not at all, they are not able to put on the market, that is, they are being attached to the head.

The initial goal of UNIX designers is to provide simple tools, however now is full of excessive design and bloated features. For example, the command of the LS file has 18 options, providing various functions from sorting to the specified display column number, and these functions can be better (formerly this). The Find command except for the Find file, the file is also outputted in the CPIO format (and this function is greatly implemented using the Unix reputation wolf.). Today, with the Unix's electric drill will have 20 knobs, with an inexpensive power cord, do not match 3/8 inch and 7/8 inch drill bits (this will be described in the BUG chapter of the manual).

Unlike the tools in the hardware store, many UNIX powerful tools are defective (sometimes fatal on files): such as Tar's unacceptable file name; for example, the UNIX debugger is always collapsed, this also Not enough, its core file will override your own core, let you take the debugger to debug the Core generated in the debug debug. Shell game

Unix inventors have a great idea: implement the command parser as a user program. If the user doesn't like the default command parser, he can write one yourself. More importantly, shell will evolve, so shell will continue to advance, become more powerful, flexible and easy to use, at least theoretically.

This is really a great idea, but it is intimate. The gradual increase in functions is a mess. Because these functions have not been designed, it is only evolved. Like the curse they have passed by all programming languages, those existing shell scripts that use these features have become the biggest enemy of the shell. As long as there is a new function to join the shell, someone will use it in his script so this feature is not old. Bad ideas and stinking strength often can't die.

So you got an incomplete, incompatible shell hodge (the following description of each shell) comes from their respective MAN Pages):

The SH is a command programming language for executing commands from terminals or files.

JSH and SH, but with CSH flavor work control (Job Control)

CSH C type syntax shell

TCSH Emacs Edit the taste of CSH

Krnshell, another command and programming language

Zsh Z shell

Bash Gun Bourne-Again Shell (GNU Bourne Reset Shell)

The screwdriver and saw in the hardware store, although it may come from 3, 4 different manufacturers, but the operating methods are almost. Typical UNIX is deposited by hundreds of programs in / bin or / usr / bin, and they come from many self-righteous programmers, with their own grammar, operating examples, and use rules (this can be used as a pipe, and that one is temporary Document), different command line parameters, and different restrictions. Take GREP and its variant fgrep, egrep, which is the fastest? Why do they accept the parameters, even the understanding of the regular expression is not the same? Why can't you have a program to provide all features? Where is the responsible guy?

When all the various types of orders are deeply branded in the mind, you can't avoid being thrown.

Shell Crash

The following message comes from the BBS of the Columbia University Compilation Principles.

Subject: Relevant UNIX bug

October 11, 1991

Classmates for W4115x courses:

We have just learned an activity record, parameter passing and function calling rules (do you know the following input will crash right right right?

:!! Xxx% s% s% s% s% s% s% s% s

Do you know why?

The following questions are for you to think:

What will shell do in "! Xxx"?

What will she do when shell encounters "! XXX% S% S% S% S% S% S% S% S"?

Why will CSHELL crash?

How will you modify the code to solve this problem?

The most important thing:

When you (yes, you) use this future operating system with 21 characters, do you think is the weather?

You can try it yourself. According to UNIX design, if the shell is falling, all your processes will be killed, and you will also be kicked out of the system. Other operating systems pop up the debugger when encountering illegal memory access errors, but not UNIX. May this is why Unix Shells does not allow you to dynamically load your module in the address space of the shell, or call the functions in other programs directly. If this is too dangerous. Step by error, 唉, you have been kicked out of the door. The stupid user should be punished, and the programmer's mistake is not tolerable.

转载请注明原文地址:https://www.9cbs.com/read-96435.html

New Post(0)