译者:后溪金
When the Bourne Shell found its identity
Bourne Shell什么时候确立身份
Computerworld is undertaking a series of investigations into the most widely-used programming languages. Previously we spoke to Alfred v. Aho of AWK fame, and in this article we chat to Chet Ramey about his experience maintaining Bash.
《计算机世界》正在就使用最广泛的一些程序设计语言进行一系列调查。先前我们谈到阿尔弗雷德·v·阿霍的AWK的名声,而在这篇文章中,我们与切特·雷米聊天,谈他维护Bash的经验。
Bash, or the Bourne-Again Shell is a Unix shell created in 1987 by Brian Fox. According to Wikipedia, the name is a pun on an earlier Unix shell by Stephen Bourne (called the Bourne shell), which was distributed with Version 7 Unix in 1978.
Bash即Bourne-Again Shell,是布赖恩·福克斯于1987年创建的一个Unix shell。按照维基百科的说法,这个名字一语双关,涉及斯蒂芬·伯恩早于1978年随Unix v7分发的Unix shell(所谓Bourne shell)。
In 1990, Chet Ramey, Manager of the Network Engineering and Security Group in Technology Infrastructure Services at Case Western Reserve University, became the primary maintainer of the language.
1990年,美国西储大学技术基础设施服务部门网络工程与安全小组经理切特·雷米成为这种语言的主要维护者。
Computerworld tracked down Ramey to find out more.
为了了解更多情况,《计算机世界》找到了雷米。
In 1989 or so, I was doing network services and server support for [Case Western Reserve] University (CWRU), and was not satisfied with the shells I had available for that work. I wasn't really interested in using sh for programming and csh/tcsh for interactive use, so I began looking around for a version of sh with the interactive features I wanted (job control, line editing, command history, filename completion, and so on.)
在1989年前后,我正在为西储大学(CWRU)做网络服务和服务器支持工作,但对那项工作中使用的一些shell并不满意。我确实没有兴趣使用sh编程,也没有兴趣用csh/tcsh与机器交互,所以,我开始四处寻找一种sh版本,具有我需要的(作业控制、行编辑、历史命令、文件名补全等等)交互式功能。
I found a couple of versions of the SVR2 shell where those features had been added (credit to Doug Gwyn, Ron Natalie, and Arnold Robbins, who had done the work). These were available to CWRU because we were Unix source licensees, but I had trouble with them and couldn't extend them the way I wanted. Ken Almquist was writing ASH, but that had not been released, and there was a clone of the 7th edition shell, which eventually became PDksh, but that did not have the features I wanted either.
我发现有几个SVR2版本的shell已经增加了那些功能(归功于做了这项工作的道格·格温、罗恩·纳塔利和阿诺德·罗宾斯)。由于CWRU是Unix源码许可证持有者,这些我们可以利用,但我和他们闹过纠纷,不能用我想用的方式扩展这些功能。肯·阿尔姆奎斯特那时候正在写ASH,不过尚未发布,另有一个shell第七版的复制品,最后变成PDKsh,但也没有我想要的特性。
Brian Fox had begun writing BASH and readline (which was not, at that time, a separate library) the year before, when he was an employee of the FSF. The story, as I recall it, was that a volunteer had come forward and offered to write a Bourne Shell clone. After some time, he had produced nothing, so Richard Stallman directed Brian to write a shell. Stallman said it should take only a couple of months.
布赖恩·福克斯一年前就已经开始编写BASH和readline(那时还不是单独一个库),当时他是自由软件基金会(FSF)的一名雇员。正如我所记得的,这个故事是,有一名志愿者自告奋勇,表示愿意编写一个Bourne Shell的翻版。但一段时间之后,他什么也没有做出来,所以,理查德·斯托尔曼指示布赖恩写一个shell。斯托尔曼表示这可能只需要两三个月的时间。
I started looking again, and ended up finding a very early version of Bash. I forget where I got it, but it was after Brian had sent a copy to Paul Placeway from Ohio State -- Paul had been the tcsh maintainer for many years, and Brian asked him to help with the line editing and redisplay code. I took that version, made job control work and fixed a number of other bugs, and sent my changes to Brian. He was impressed enough to begin working with me, and we went on from there.
我又开始寻找,最终找到Bash的一个非常早的版本。我忘记在什么地方得到它,但是在布赖恩送一个副本给俄亥俄州的保罗·普莱斯威之后得到的——保罗多年来一直是tcsh的维护人员,而且布赖恩要求他帮助编写行编辑和重新显示的代码。我采用了这一版本,使作业控制起作用,并修复了许多其他错误,然后把我所做的改动发送给布赖恩。这给他留下相当深刻的印象,开始和我一起工作,我们就从那里继续前进。
I fixed many of the bugs people reported in the first public versions of BASH and fed those fixes back to Brian. We began working together as more or less co-maintainers, and when Brian moved on to other things, I still needed to support Bash for my local users, so I produced several local releases. Brian and I eventually merged those versions together, and when he moved away from Bash development, I took over.
我修复了人们报告的第一个BASH公开版本中的许多故障和错误,并把这些反馈给布赖恩。我们开始一起工作,差不多是共同维护者,当布赖恩转而从事其他事情时,我仍然需要为我所在地的用户支持Bash,所以,我制作了若干个本地发行的版本。布莱恩和我最后把这些版本合并起来,在他不再从事Bash开发离开时,我就接手了。
Brian and I worked together for several years before he moved on to other things. The versions through BASH-1.13 were collaborative releases.
布莱恩和我一起工作了好几年之后才转到其他事情上。BASH从头到1.13版都是合作完成的版本。
Our working relationship was very good, especially considering we met in person only once, in 1990. We were heavy users of UNIX `talk' and `ntalk', which allowed real-time two-way communication over the Internet back then, and made good use of email and the occasional long distance phone call.
我们过去的工作关系非常好,特别是考虑到我们俩只在1990年见过一次面。我们都是UNIX系统“talk”和“ntalk”的重度用户(大量使用者),那时候就让我们在互联网上实现实时双向通信,我们也充分利用电子邮件并偶尔打打长途电话。
We still stay in touch.
现在我们仍然保持联系。
When Richard Stallman decided to create a full replacement for the then-encumbered Unix systems, he knew that he would eventually have to have replacements for all of the common utilities, especially the standard shell, and those replacements would have to have acceptable licensing.
当理查德·斯托尔曼决定创建一个完整的替代品,取代当时已成拖累的Unix系统的时候,他知道,他最终将不得不替换所有常用的实用程序,特别是标准shell,而这些替代品就必须有可接受的许可证。
After a couple of false starts (as previously mentioned), he hired Brian Fox to write it.
几个失败的开端(如前所述)之后,他聘请布赖恩·福克斯编写Bash。
They decided early on that they would implement the shell as defined by the Posix standard, and used that as a specification.
他们一开始就决定,将按POSIX标准的定义实现shell,并且把POSIX标准用作技术规范。
In BASH's case, the problem to be solved was a free software version of the Posix standard shell to be part of the GNU system.
就BASH的情况,要解决的问题是符合POSIX标准的自由软件版shell成为GNU系统的一部分。
The original version of the shell (Steve Bourne's version) was intended to overcome a number of the limitations of the Unix shell included in versions up to the sixth edition, originally written by Ken Thompson.
Shell的原始版本(史蒂夫·伯恩的版本)打算克服包括直至Unix第六版的各个shell版本的许多限制,Unix最初由肯·汤普森编写。
Brian wanted to move on to other things, and I was a developer willing to take it on and experienced with the code. Brian and the FSF trusted me with the program's future.
布赖恩希望改做别的事情,我是开发人员,愿意承担并感受体验这些代码。布赖恩和FSF把这个程序托给我管理。
Any good heavily-used program needs good reference documentation, and BASH is no exception. I originally wrote the documents to support my local users, and they were folded into "official" releases along the line.
凡是使用率高的好程序都需要好的参考文档,BASH也不例外。我最初是为了支持本地用户才编写文档,然后才被并入“官方的”版本到处发布。
I'd say there is a linear relationship: the original Bourne Shell was very influential, the various System V shell releases preserved that heritage, and the Posix committee used those versions as the basis for the standard they developed.
我想有一个线性关系:原来的Bourne Shell非常有影响,各种不同的System V shell发行版都保留这一遗产,而且POSIX委员会使用这些版本作为他们制定标准的基础。
Certainly the basic language syntax and built-in commands are direct descendants of the Bourne Shell's. Bash's additional features and functionality build on what the Bourne shell provided.
当然,这种语言的基本语法和内置命令是Bourne Shell的直接后裔。Bash增加的特性和功能以Bourne Shell所提供的为基础。
As for source code and internal implementation, there's no relationship at all, of course.
至于源代码及其内部实现,当然,根本就没有关系。
The FSF has a penchant for puns, and this one seemed appropriate, I suppose. The name predates my involvement.
自由软件基金会对双关语有强烈嗜好,而且我以为,这一个看来好象是相称的。这一名字早在我参与之前就有。
The hardest decisions are the ones dealing with compatibility: how compatible to be with the versions of sh existing at various points throughout Bash's history; how compatible to be with the features from the Korn shell I considered valuable; where and how to differ from the Posix standard, and when to break backwards compatibility with previous Bash versions to correct mistakes I had made.
最困难的决策涉及兼容性:如何与存在于Bash历史不同时期的sh版本兼容;如何与属于我认为有价值的Korn shell的特色兼容;何处并且如何不同于POSIX标准,以及何时打破以前的Bash版本的向后兼容,以改正我所犯的错误。
Some of the features implemented (and not implemented) required a lot of thought and consideration -- not how to implement them, but whether or not to invest the resources to do so. Most of the Bash development over the past 15 years has been done by one person.
某些已经实现(和未实现)的特性需要大量的思考和考虑——不是如何实现,而是是否要花费资源这样做。过去15年所做的Bash开发的大部分由一个人完成。
I am. In fact, the next major release of Bash, Bash-4.0, should be out sometime this (Northern) summer.
是的。其实,Bash的下一个主要版本,Bash-4.0,将会在今年夏天(在美国北方)问世。
I mostly use Bash for interactive work these days. I use it to write some small system administration tools, but I don't do much system administration any more.
我目前使用Bash大部分用来做人机交互工作。我用它编写一些小型系统管理工具,但我几乎不再做系统管理工作。
That's hard to say. Lots of interesting projects have been implemented as shell scripts, or sets of shell scripts.
这很难说。许多有趣的项目已经用shell脚本、或shell脚本套件实现。
I particularly like the various versions of the Bash debugger that were implemented completely as shell scripts. That's pretty complex work. I've seen entire web servers and other surprisingly substantial applications written as shell scripts.
我特别喜欢各种版本的Bash调试器,完全像shell脚本一样执行。这是颇为复杂的工作。我已经看到把整个网络服务器和其他令人惊讶的实质性的应用软件写成shell脚本。
I think Bash's legacy is as a solid piece of infrastructure, and the shell making millions of Linux, Mac OS X, and Solaris systems work every day.
我认为,Bash留给后人的东西就是作为部分稳定可靠的基础设施,并且使数以百万计的Linux、Mac OS X和Solaris系统每一天都正常运转。
As I recall, it was one of the first couple of programs Linus Torvalds made run on his early Linux kernels.
我记得,Bash也是莱纳斯·托瓦尔兹在他早期的Linux内核中最早运行的一些程序之一。
Bash will continue to evolve as both an interactive environment and a programming language. I'd like to add more features that allow interested users to extend the shell in novel ways. The programmable completion system is an example of that kind of extension.
Bash既是一个交互环境又是一种编程语言,将会继续发展。我想会增加更多的特性,让有兴趣的用户以新颖的方式扩展shell。可编程的完备系统就是那种扩展的一个例子。
Bash's evolution has always been user-driven, so it will ultimately be up to the feature requests that come in.
Bash的演变一直是用户驱动的,所以它最终将胜任未来出现的功能请求。
I see increased dynamism, allowing programmers to do more and more complex things on the fly, especially over the Web. The advances in hardware allow interpreted code to run faster today than compiled code on some systems available when I started work on Bash.
我看到更多的活力,让程序员匆忙中做越来越复杂的东西,特别是通过网络。就Bash而论,硬件的进步使今天的解释型代码运行速度快于当初我开始工作时可用的一些系统上的编译型代码。
Find an area that interests you and get involved with an existing community. There are free software projects in just about any area of programming.
找到您感兴趣的领域,并参与现存的某个社区。几乎任何一个程序设计领域都有一些自由软件项目。
The nuts-and-bolts -- which language you use, what programming environment you use, where you do your work -- are not as important as the passion and interest you bring to the work itself.
具体情况——使用哪一种语言、使用什么样的编程环境、在什么地方工作——都不如工作本身带来的热情和兴趣重要。
The free software community is still as vibrant today, maybe even more so, than when I first became involved. There is still a lot of room for significant contributions; all it takes is an interested person with a good idea.
今天,自由软件社区依然像我最初参与时一样充满活力,也许更加生气勃勃。这些社区仍然给重大贡献留有大量空间;它接受的全部是一个有好主意的感兴趣的人。
阅读原文