Chinaunix首页 | 论坛 | 博客
  • 博客访问: 151293
  • 博文数量: 32
  • 博客积分: 2053
  • 博客等级: 大尉
  • 技术积分: 382
  • 用 户 组: 普通用户
  • 注册时间: 2010-04-09 12:45
文章分类

全部博文(32)

文章存档

2011年(12)

2010年(20)

分类:

2010-09-06 20:47:15

Thompson shell
From Wikipedia, the free encyclopedia
Jump to: navigation, search
Thompson shell Original author(s)     Ken Thompson
Initial release     1971
Operating system     Unix
License     Unix shell

The Thompson shell was the first Unix shell, introduced in the first version of Unix in 1971, and was written by Ken Thompson. It was a simple command interpreter, not designed for scripting, but nonetheless introduced several innovative features to the command line interface and led to the development of the later Unix shells.
Contents

    * 1 History
    * 2 Decline and replacements
    * 3 See also
    * 4 External links

1.History

The name "shell" for a command line interpreter and the concept of making the shell a user program outside of the operating system kernel were introduced in Unix's precursor Multics.

An early feature of the Thompson shell was a compact syntax for input/output redirection. In Multics, redirecting the input or output of a command required separate commands to start and stop redirection; in Unix, one could simply add an argument to the command line consisting of the < symbol followed by a filename for input or the > symbol for output, and the shell would redirect I/O for the duration of the command. This syntax was already present by the release of the first version of Unix in 1971.

A later addition was the concept of pipes. At the suggestion of Douglas McIlroy, the redirection syntax was expanded so that the output of one command could be passed to the input of another command. The original pipe syntax, as described in the Version 3 manual, was:

command1 >command2>

This syntax proved too ambiguous and was easily confused with redirection to and from files. By Version 4, the syntax had changed to use both the | and ^ symbols to denote pipes:

command1 | command2

This produces exactly the same result as:

command1 ^ command2

The Thompson shell syntax for redirection with < and >, and piping with |, has proven durable and has been adopted by most other Unix shells and command shells of several other operating systems, most notably on DOS, OS/2 and Microsoft Windows.


2.Decline and replacements

The shell's design was intentionally minimalistic; even the if and goto statements, essential for control of program flow, were implemented as separate commands. As a result, by the 1975 release of Unix Version 6, it was becoming clear that the Thompson shell was inadequate for most serious programming tasks.

At this time, the developers of the Programmer's Workbench UNIX distribution, most notably John Mashey, began modifying the Thompson shell to make it more suitable for programming. The result, known as the PWB shell or the Mashey shell, included more advanced flow-control mechanisms and introduced shell variables, but remained limited by the necessity to remain compatible with the Thompson shell.

Finally, the Thompson shell was replaced as the main Unix shell by the Bourne shell in Unix Version 7 and the C shell in 2BSD, both released in 1979. Since virtually all modern Unix and Unix-like systems are descended from V7 and 2BSD, the Thompson shell is generally no longer used. It is, however, available as open source as part of several Ancient Unix source distributions, and has been ported to modern Unices as a historical exhibit.




ps
1.The first Unix shell, Ken Thompson's sh, was modeled after the Multics shell. The Bourne shell is a descendant of the first Unix shell.


2.Thompson Shell Version6 源码
文件:v6sh.tar
大小:40KB
下载:下载

3. The UNIX Time-Sharing System摘录
Other Programs as Shell
The Shell as described above is designed to allow usersfull access to the facilities of the system since it will invoke the execution of any program with appropriate protection mode. Sometimes, however, a different interface to the system is desirable, and this feature is easily arranged.Recall that after a user has successfully logged in by supplying his name and password, init ordinarily invokes the Shell to interpret command lines. The user’s entry in tile password file may contain the name of a program to be invoked after login instead of the Shell. This program is free to interpret the user’s messages in any way it wishes.For example, the password file entries for users of a secretarial editing system specify that the editor ed is to be used instead of the Shell. Thus when editing system users log in, they are inside the editor and can begin work immediately; also, they can be prevented from invoking UNIX programs not intended for their use. In practice, it has proved desirable to allow a temporary escape from the editor to execute the formatting program and other utilities.Several of the games (e.g. chess, blackjack, 3D tic-tac-toe) available on UNIX illustrate a much more severely restricted environment. For each of these an entry exists in the password file specifying that the appropriate game-playing program is to be invoked instead of the Shell. People who log in as a player of one of the games find them-selves limited to the game and unable to investigate the presumably more interesting offerings of UNIX as a whole.

this is interesting!!
阅读(1148) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~