⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 e1

📁 UNIX v6源代码 这几乎是最经典的unix版本 unix操作系统设计和莱昂氏unix源代码分析都是用的该版
💻
字号:
.TLA Tutorial Introduction to the \s-2UNIX\s+2 Text Editor.sp.AUB. W. Kernighan.sp.AIBell Laboratories, Murray Hill, N. J..nr PS 9.nr VS 11.if t .2C.H1Introduction.H2.PG.ulEdis a ``text editor'', that is, an interactive programfor creating and modifying ``text'',using directions provided by a user ata terminal.The text is often a documentlike this one,or a programor perhaps data for a program..PGThis introduction is meant to simplify learning.uled.The recommended way to learn.uledis to read this document,simultaneously using.uledto follow the examples,then to read the description in section I of the.S1UNIX.S2manual, all the whileexperimenting with.uled.(Solicitation of advice from experienced users is also useful.).PGDo the exercises!They cover material not completely discussedin the actual text.An appendix summarizes the commands..H1Disclaimer.H2.PGThis is an introduction and a tutorial.For this reason, no attempt is made tocover more than a part of the facilities that.uledoffers(although this fraction includes the most useful and frequently usedparts).Also,there is not enough space to explain basic.S1UNIX.S2procedures.We will assume that you know how to log on to.S1UNIX,.S2and that you have at least a vague understandingof what a file is..PGYou must also know what character to type as the end-of-lineon your particular terminal.This is a ``newline'' on Model 37 Teletypes,and ``return'' on most others.Throughout, we will refer to this character,whatever it is,as ``newline''..H1Getting Started.H2.PGWe'll assume that you have logged in to.S1UNIX.S2and it has just said ``%''.Theeasiest way to get.uledis to type.X1ed	(followed by a newline).X2You are now ready to go \(mi.uledis waiting for you to tell it what to do..H1Creating Text \(mi the Append command ``a''.H2.PGAs our first problem, suppose we want to create some textstarting from scratch.Perhaps we are typing the very firstdraft of a paper; clearly it will have to startsomewhere, and undergo modifications later.This section will show how to get some text in, just toget started.Later we'll talk about how to change it..PGWhen.uledis first started, it is rather like workingwith a blank piece of paper \(mi there is no textor information present.This must be supplied by the person using.uled;it is usually doneby typing in the text, or by reading it into.uledfrom afile.We will start by typing in some text, and return shortly to how toread files..PGFirst a bit of terminology.In.uledjargon, the text beingworked on is said to be ``kept in a buffer.''Think of thebuffer as a work space, if you like, or simply as the informationthat you are going to be editing.In effect the buffer is like thepiece of paper, on which we will write things, then change someof them, and finally file the whole thing away for another day..PGThe user tells.uledwhat to do to his textby typing instructions called ``commands.''Mostcommands consist of a single letter,which must be typed in lower case.Each command is typedon a separate line.(Sometimes the command is preceded by informationabout what line or lines of text are to be affected \(miwe will discuss these shortly.).ulEdmakes no responseto most commands \(mi there is no promptingor typing of messages like ``ready''.(This silence is preferredby experienced users, but sometimes a hangup for beginners.).PGThe first command is.ulappend,written as the letter.X1a.X2allby itself.It means ``append (or add) text lines to the buffer,as I type them in.''Appending is rather likewriting fresh material on a piece of paper..PGSo to enter lines of text into the buffer,we just type an ``a'' followed by anewline, followed by the lines of text we want, like this:.X1aNow is the timefor all good mento come to the aid of their party..li\fB.\fR.X2.PGThe only way to stop appending is to type aline that contains only a period.The ``\*.'' is usedto tell.uledthat we have finished appending.(Even experienced users forget that terminating ``\*.''sometimes.If.uledseems to be ignoring you,type an extra line with just ``\*.'' on it.You may then find you've added some garbage linesto your text, which you'll have to take out later.).PGAfter the append command has been done, the buffer willcontain the three lines.X1Now is the timefor all good mento come to the aid of their party..X2The ``a'' and ``\*.'' aren't there, because they arenot text..PGTo add more text to what we already have,just issue another ``a'' command, and continue typing..H1Error Messages \(mi ``?''.H2.PGIf at any time you make an error in the commands you type to.uled,it will tell you by typing.X1?.X2This is about as cryptic as it can be,but with practice, you can usuallyfigure out how you goofed.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -