Invoking a w k. Formatter Escape Sequences. Local Horizontal Motions. Creating a Custom Macro Package. Saving an External Table of Contents. That computers can be used productively by writers, not just research scientists, accountants, and secretaries, is not so widely recognized. Today, writers not only work with words, they work with computers and the software programs, printers, and terminals that are part of a computer system. The computer has not simply replaced a typewriter; it has become a system for integrating many other technologies.
As these technologies are made available at a rea- sonable cost, writers may begin to find themselves in new roles as computer program- mers, systems integrators, data base managers, graphic designers, typesetters, printers, and archivists. The writer functioning in these new roles is faced with additional responsibilities.
Obviously, it is one thing to have a tool available and another thing to use it skillfully. Like a craftsman, the writer must develop a number of specialized skills, gaining con- trol over the method of production as well as the product. The writer must look for ways to improve the process by integrating new technologies and designing new tools in software. In this book, we want to show how computers can be used effectively in the preparation of written documents, especially in the process of producing book-length documents. Surely it is important to learn the tools of the trade, and we will demon- strate the tools available in the UNIX environment.
However, it is also valuable to examine text processing in terms of problems and solutions: the problems faced by a writer undertaking a large writing project and the solutions offered by using the resources and power of a computer system. In Chapter 1, we begin by outlining the general capabilities of word-processing systems.
Then, hav- ing defined basic word-processing capabilities, we look at how a text-processing system includes and extends these capabilities and benefits. Last, we introduce the set of text-. These tools, used individually or in combi- nation, provide the basic framework for a text-processing system, one that can be custom-tailored to supply additional capabilities. Chapter 2 gives a brief review of UNIX fundamentals. We assume you are already somewhat acquainted with UNIX, but we included this information to make sure that you are familiar with basic concepts that we will be relying on later in the book.
Chapter 3 introduces the v i editor, a basic tool for entering and editing text. Although many other editors and word-processing programs are available with UNIX, v i has the advantage that it works, without modification, on almost every UNIX sys- tem and with almost every type of terminal. Chapter 4 introduces the nrof f and t r o f f formatting programs. Because v i is a text editor, not a word-processing program, it does only rudimentary formatting of the text you enter. You can enter special formatting codes to specify how you want the document to look, then format the text using either n r o f f or t r o f f.
The n r o f f formatter is used for formatting documents to the screen or to typewriter-like printers; t r o f f uses much the same formatting language, but has additional con- structs that allow it to produce more elaborate effects on typesetters and laser printers. In this chapter, we also describe the different types of output devices for printing your finished documents.
The formatting markup language required by n r o f f and t r o f f is quite com- plex, because it allows detailed control over the placement of every character on the page, as well as a large number of programming constructs that you can use to define custom formatting requests or macros. A number of macro packages have been developed to make the markup language easier to use. These macro packages define commonly used formatting requests for different types of documents, set up default values for page layout, and so on. Although someone working with the macro packages does not need to know about the underlying requests in the formatting language used by n r o f f and t r o f f , we believe that the reader wants to go beyond the basics.
As a result, Chapter 4 intro- duces additional basic requests that the casual user might not need. However, your understanding of what is going on should be considerably enhanced. There are two principal macro packages in use today, m s and mm named for the command-line options to nro f f and t r o f f used to invoke them. If you are lucky enough to have both macro packages on your system, you can choose which one you want to learn. Other- wise, you should read either Chapter 5, The ms Macros, or Chapter 6, The m m Macros, depending on which version you have available.
Chapter 7 returns to v i to consider its more advanced features. In addition, it takes a look at how some of these features can support easy entry of formatting codes used by n r o f f and t r o f f. Tables and mathematical equations provide special formatting problems. The low-level n r o f f and t r o f f commands for typesetting a complex table or equation are extraordinarily complex.
However, no one needs to learn or type these commands, because two preprocessors, t b l and eqn, take a high-level specification of the table or equation and do the dirty work for you. The t b l and eqn preprocessors are described in Chapters 8 and 9, respectively. We talk about pi c in Chapter Chapter 1 1 introduces a range of other UNIX text-processing tools-programs for sorting, comparing, and in various ways examining the contents of text files. This concludes the first part of the book, which covers the tools that the writer finds at hand in the UNIX environment.
This material is not elementary. In places, it grows quite complex. That is the real beauty of the UNIX environment. The second part of the book begins with Chapter 12, on editing scripts. There are several editors in UNIX that allow you to write and save what essentially amount to programs for manipulating text. The e x editor can be used from within v i to make global changes or complex edits.
The next step is to use e x on its own; and after you do that, it is a small step to the even more powerful global editor sed. After you have mastered these tools, you can build a library of special-purpose editing scripts that vastly extend your power over the recalcitrant words you have put down on paper and now wish to change. Chapter 13 discusses another program-auk-that extends the concept of a text editor even further than the programs discussed in Chapter The auk program is really a database programming language that is appropriate for performing certain kinds of text-processing tasks.
In particular, we use it in this book to process output from t r o f f for indexing. The next five chapters turn to the details of writing t r o f f macros, and show how to customize the formatting language to simplify formatting tasks. We start in Chapter 14 by looking at the basic requests used to build macros, then go on in Chapter 15 to the requests for achieving various types of special effects. To complete these tasks, we need to return to the UNIX shell in Chapter 18 and examine in more detail the ways that it allows you to incorporate the many tools pro- vided by UNIX into an integrated text-processing environment.
Before we turn to the subject at hand, a few acknowledgements are in order. Though only two names appear on the cover of this book, it is in fact the work of many hands. Donna was new to our staff when she took on responsibility for the job of copyfitting-that final stage in page layout made especially arduous by the many fig- ures and examples in this book.
She and Linda especially spent many long hours get- ting this book ready for the printer. Linda had the special job of doing the final con- sistency check on examples, making sure that copyediting changes or typesetting errors had not compromized the accuracy of the examples. Special thanks go to Steve Talbott of Masscomp, who first introduced us to the power of t r o f f and who wrote the first version of the extended m s macros, f o r - mat shell script, and indexing mechanism described in the second half of this book.
Thanks also to the excellent production editors at Sams, Wendy Ford, Lou Keglovitz, and especially Susan Pink Bussiere, whose copyediting was outstanding. We are grateful for their thoughtful and thorough review of this book for technical accuracy. We must, of course, make the usual disclaimer: any errors that remain are our own.
Steve and Pat also provided the macros to typeset the book. Before we consider the special tools that the UNIX environment provides for text pro- cessing, we need to think about the underlying changes in the process of writing that are inevitable when you begin to use a computer. The most important features of a computer program for writers are the ability to remember what is typed and the ability to allow incremental changes-no more retyping from scratch each time a draft is revised.
For a writer first encountering word- processing software, no other features even begin to compare. The crudest command structure, the most elementary formatting capabilities, will be forgiven because of the immense labor savings that take place. Writing is basically an iterative process. It is a rare writer who dashes out a fin- ished piece; most of us work in circles, returning again and again to the same piece of prose, adding or deleting words, phrases, and sentences, changing the order of thoughts, and elaborating a single sentence into pages of text.
A writer working on paper periodically needs to clear the deck-to type a clean copy, free of elaboration. As the writer reads the new copy, the process of revision continues, a word here, a sentence there, until the new draft is as obscured by changes as the first. It is abandoned. As dedicated word processors were replaced with low-cost personal computers, writers were quick to see the value of this new tool. In a civilization obsessed with the written word, it is no accident that WordStar, a word- processing program, was one of the first best sellers of the personal computer revolu- tion.
As you learn to write with a word processor, your working style changes. Because it is so easy to make revisions, it is much more forgivable to think with your fingers when you write, rather than to carefully outline your thoughts beforehand and polish each sentence as you create it. If you do work from an outline, you can enter it first, then write your first draft by filling in the outline, section by section. In either case, it i s easy to write in small segments that can be moved as you reorganize your ideas.
Watching a writer at work on a word processor is very different from watching a writer at work on a typewriter. A typewriter tends to enforce a linear flow-you must write a passage and then go back later to revise it. On a word processor, revisions are constant-you type a sentence, then go back to change the sentence above. Perhaps you write a few words, change your mind, and back up to take a different tack; or you decide the paragraph you just wrote would make more sense if you put it ahead of the one you wrote before, and move it on the spot.
This is not to say that a written work is created on a word processor in a single smooth flow; in fact, the writer using a word processor tends to create many more drafts than a compatriot who still uses a pen or typewriter. Instead of three or four drafts, the writer may produce ten or twenty.
There is still a certain editorial distance that comes only when you read a printed copy. This is especially true when that printed copy is nicely formatted and letter perfect. This brings us to the second major benefit of word-processing programs: they help the writer with simple formatting of a document. For example, a word processor may automatically insert carriage returns at the end of each line and adjust the space between words so that all the lines are the same length. Even more importantly, the text is automatically readjusted when you make changes.
There are probably commands for centering, underlining, and boldfacing text. The rough formatting of a document can cover a multitude of sins. A s you read through your scrawled markup of a preliminary typewritten draft, it is easy to lose track of the overall flow of the document.
- How to Sell Used Books on Amazon: The Stay at Home Moms Secret Guide to Selling Books on Amazon.
- Euro-Par 2007 Parallel Processing: 13th International Euro-Par Conference, Rennes ,France , August 28-31, 2007. Proceedings;
- Knowledge Networks for Business Growth.
Not so when you have a clean copy-the flaws of organization and content stand out vividly against the crisp new sheets of paper. However, the added capability to print a clean draft after each revision also puts an added burden on the writer. Where once you had only to worry about content, you may now find yourself fussing with consistency of margins, headings, boldface, italics, and all the other formerly superfluous impedimenta that have now become integral to your task.
A Workspace One of the most important capabilities of a word processor is that it provides a space in which you can create documents. In one sense, the video display screen on your termi- nal, which echoes the characters you type, is analogous to a sheet of paper. But the workspace of a word processor i s not so unambiguous as a sheet of paper wound into a typewriter, that may be added neatly to the stack of completed work when finished, or tom out and crumpled as a false start.
This buffer is a temporary holding area for storing your work and is emptied at the end of each session. To save your work, you have to write the contents of the buffer to a file. A file is a permanent storage area on a disk a hard disk or a floppy disk. After you have saved your work in a file, you can retrieve it for use in another session. When you begin a session editing a document that exists on file, a copy of the file is made and its contents are read into the buffer. You actually work on the copy, mak- ing changes to it, not the original.
The file is not changed until you save your changes during or at the end of your work session. You can also discard changes made to the buffered copy, keeping the original file intact, or save multiple versions of a document in separate files. Particularly when working with larger documents, the management of disk files can become a major effort. If, like most writers, you save multiple drafts, it is easy to lose track of which version of a file is the latest.
An ideal text-processing environment for serious writers should provide tools for saving and managing multiple drafts on disk, not just on paper. It should allow the writer to. Most word-processing programs for personal computers seem to work best for short documents such as the letters and memos that offices chum out by the millions each day. Although it is possible to create longer documents, many features that would help organize a large document such as a book or manual are missing from these programs. However, long before word processors became popular, programmers were using another class of programs called text editors.
Text editors were designed chiefly for entering computer programs, not text. Furthermore, they were designed for use by com- puter professionals, not computer novices. A s a result, a text editor can be more diffi- cult to learn, lacking many on-screen formatting features available with most word pro- cessors. Nonetheless, the text editors used in program development environments can pro- vide much better facilities for managing large writing projects than their office word- processing counterparts.
Large programs, like large documents, are often contained in many separate files; furthermore, it is essential to track the differences between versions of a program. UNIX is a pre-eminent program development environment and, as such, it is also a superb document development environment. Although its text editing tools at first may appear limited in contrast to sophisticated office word processors, they are in fact considerably more powerful. Tools for Editing For many, the ability to retrieve a document from a file and make multiple revisions painlessly makes it impossible to write at a typewriter again.
However, before you can get the benefits of word processing, there is a lot to learn. Editing operations are performed by issuing commands. Each word-processing system has its own unique set of commands. A t a minimum, there are commands to. To make changes to a document, you must be able to move to that place in the text where YOU want to make your edits. Most documents are too large to be displayed in their entirety on a single terminal screen, which generally displays 24 lines of text. Usually only a portion of a document is displayed. This partial view of your document i s sometimes referred to as a window.
Montclair State University
A cursor an underline or block marks your current position in the window. There are basically two kinds of movement:. When you begin a session, the first line of text is the first line in the window, and the cursor is positioned on the first character. Scrolling commands change which lines are displayed in the window by moving forward or backward through the document.
Cursor-positioning commands allow you to move up and down to individual lines, and along lines to particular characters. After you position the cursor, you must issue a command to make the desired edit. The command you choose indicates how much text will be affected: a character, a word, a line, or a sentence. Because the same keyboard is used to enter both text and commands, there must be some way to distinguish between the two.
Some word-processing programs assume that you are entering text unIess you specify otherwise; newly entered text either. In addition, many high-powered UNIX workstations with large bit-mapped screens have their own windowing software that allows multiple programs to be run simultaneously in separate windows. For purposes of this book, we assume you are using the v i editor and an alphanumeric terminal with only a single window.
Commands are entered by pressing special keys on the keyboard, or by combining a standard key with a special key, such as the control key CTRL. Other programs assume that you are issuing commands; you must enter a com- mand before you can type any text at all.
Unix Text Processing (Hayden Books Unix Library System)
There are advantages and disadvantages to each approach. Starting out in text mode is more intuitive to those coming from a type- writer, but may be slower for experienced writers, because all commands must be entered by special key combinations that are often hard to reach and slow down typing. Far more significant than the style of command entry is the range and speed of commands. For example, though it is heaven for someone used to a typewriter to be able to delete a word and type in a replacement, it is even better to be able to issue a command that will replace every occurrence of that word in an entire document.
And, after you start making such global changes, it is essential to have some way to undo them if you make a mistake. A word processor that substitutes ease of learning for ease of use by having fewer commands will ultimately fail the serious writer, because the investment of time spent learning complex commands can easily be repaid when they simplify complex tasks.
The extra seconds add up when you spend hours or days at the keyboard, and, once having been given a taste of freedom from drudgery, writers want as much freedom as they can get. Text editors were developed before word processors in the rapid evolution of computers. Many of them were originally designed for printing terminals, rather than for the CRT-based terminals used by word processors. These programs tend to have commands that work with text on a line-by-line basis. These commands are often more obscure than the equivalent office word-processing commands.
However, though the commands used by text editors are sometimes more difficult to learn, they are usually very effective. The commands designed for use with slow paper terminals were often extraordinarily powerful, to make up for the limited capabili- ties of the input and output device.
There are two basic kinds of text editors, line editors and screen editors, and both are available in UNIX. The difference is simple: line editors display one line at a time, and screen editors can display approximately 24 lines or a full screen. The line editors in UNIX include ed, sed, and ex. Although these line edi- tors are obsolete for general-purpose use by writers, there are applications at which they excel, as we will see in Chapters 7 and The most common screen editor in UNIX is v i.
Learning v i or some other suitable editor is the first step in mastering the UNIX text-processing environment. Most of your time will be spent using the editor. UNIX screen editors such as v i and emacs another editor available on many UNIX systems lack ease-of-learning features common in many word processors-there are no menus and only primitive on-line help screens, and the commands are often com- plex and nonintuitive-but they are powerful and fast. Such editing scripts open new ranges of capability to the writer.
Document Formatting Text editing is wonderful, but the object of the writing process is to produce a printed document for others to read. And a printed document is more than words on paper; it is an arrangement of text on a page.
0.2. Availability of sed and awk
For instance, the elements of a business letter are arranged in a consistent format, which helps the person reading the letter identify those elements. Reports and more complex documents, such as technical manuals or books, require even greater attention to formatting. The format of a document conveys how information is organized, assisting in the presentation of ideas to a reader. Most word-processing programs have built-in formatting capabilities. Formatting commands are intermixed with editing commands, so that you can shape your document on the screen.
Such formatting commands are simple extensions of those available to someone working with a typewriter. For example, an automatic centering command saves the trouble of manually counting characters to center a title or other text. There may also be such features as automatic pagination and printing of headers or footers. Text editors, by contrast, usually have few formatting capabilities.
Because they were designed for entering programs, their formatting capabilities tend to be oriented toward the formats required by one or more programming languages. Even programmers write reports, however. Word processing, with its emphasis on easy-to-use programs with simple on- screen formatting, was in its infancy. Computerized phototypesetting, on the other hand, was already a developed art. Until quite recently, it was not possible to represent on a video screen the variable type styles and sizes used in typeset documents. As a result, phototypesetting has long used a markup system that indicates formatting instruc- tions with special codes.
These formatting instructions to the computerized typesetter are often direct descendants of the instructions that were formerly given to a human typesetter-center the next line, indent five spaces, boldface this heading. The text formatter most commonly used with the UNIX system is called n r o f f. To use it, you must intersperse formatting instructions usually one- or two-letter codes preceded by a period within your text, then pass the file through the formatter.
The n r o f f formatter prepares documents for printing on line printers, dot-matrix printers, and letter-quality printers. Another pro- gram called t r o f f uses an extended version of the same markup language used by n r o f f , but prepares documents for printing on laser printers and typesetters. First, unless you are using a very sophisticated computer, with very sophisticated software what has come to be called an electronic publishing system, rather than a mere word processor , it is not possible to display everything on the screen just as it will appear on the printed page.
For example, the screen may not be able to represent boldfacing or underlining except with special formatting codes. Wordstar, one of the grandfathers of word-processing programs for personal computers, represents underlin- ing by surrounding the word or words to be underlined with the special control charac- ter AS the character generated by holding down the control key while typing the letter S. Is this really superior to the following nrof f construct?
It is perhaps unfair to pick on Wordstar, an older word-processing program, but very few word-processing programs can complete the illusion that what you see on the screen is what you will get on paper. There is usually some mix of control codes with on-screen formatting. More to the point, though, is the fact that most word processors are oriented toward the production of short documents. When you get beyond a letter, memo, or report, you start to understand that there is more to formatting than meets the eye. The design of a large document is often determined before writing is begun, just as a set of plans for a house are drawn up before anyone starts construction.
The design is a plan for organizing a document, arranging various parts so that the same types of material are handled in the same way. The parts of a document might be chapters, sections, or subsections. For instance, a technical manual is often organized into chapters and appendices. Within each chapter, there might be numbered sections that are further divided into three or four lev- els of subsections. Document design seeks to accomplish across? It presents the structure of a document and helps the reader locate information.
Each of the parts must be clearly identified. The design specifies how they will look, trying to achieve consistency throughout the document. The strategy might specify that major section headings will be all uppercase, underlined, with three blank lines above and two below, and secondary headings will be in uppercase and lowercase, underlined, with two blank lines above and one below. If you have ever tried to format a large document using a word processor, you have probably found it difficult to enforce consistency in such formatting details as these.
- Similar authors to follow.
- An Annotated Bibliography | SpringerLink;
- Accounting for Managers: Interpreting Accounting Information for Decision-Making.
- Origin of Haloes;
- Toolbar Links.
- Navigation menu.
By contrast, a markup language-especially one like nrof f that allows you to define repeated command sequences, or macros-makes it easy: the style of a heading is defined once, and a code used to reference it. For example, a top-level heading might be specified by the code. H 1 , and a secondary heading by H2.
Even more significantly, if you later decide to change the design, you simply change the definition o f the relevant design elements. If you have used a word proces- sor to format the document as it was written, it is usually a painful task to go back and change the format. Some word-processing programs, such as Microsoft WORD, include features for defining global document formats, but these features are not as widespread as they are in markup systems.
Printing The formatting capabilities of a word-processing system are limited by what can be out- put on a printer. For example, some printers cannot backspace and therefore cannot underline. For this discussion, we are considering four different classes of printers: dot matrix, letter quality, phototypesetter, and laser. A dot-matrix printer composes characters as a series o f dots.
It is usually suitable for preparing interoffice memos and obtaining fast printouts o f large files. It m e 5 a print head cc. More rophicated dot-aatrix p r i n t e r s h a r e p r i n t heads contaising up t o 24 pins. The greater t h e nufiber o f pins, the finer t h e d o t s?
A letter-quality printer is more expensive and slower. Its printing mechanism operates like a typewriter and achieves a similar result. This paragraph was printed with a letter- quality printer. It is essentially a computer-controlled typewriter and, like a typewriter, uses a print ball or wheel containing fully formed characters.
A letter-quality printer produces clearer, easier-to-read copy than a dot-matrix printer. Letter-quality printers are generally used in offices for formal correspondence as well as for the final drafts of proposals and reports. Until very recently, documents that needed a higher quality o f printing than that available with letter-quality printers were sent out for typesetting. Even if draft copy was word-processed, the material was often re-entered by the typesetter, although many typesetting companies can read the files created by popular word-processing programs and use them as a starting point for typesetting.
This paragraph, like the rest of this book, was phototypeset. In photo- typesetting, a photographic technique is used to print characters on film or photographic paper. There is a wide choice of type styles, and the charac- ters are much more finely formed that those produced by a letter-quality printer. Characters are produced by an arrangement of tiny dots, much like a dot-matrix printer-but there are over dots per inch. There are several major advantages to typesetting. The high resolution allows for the design of aesthetically pleasing type.
The shape of the characters is much finer. In addition, where dot-matrix and letter-quality type is usually constant width narrow letters like i take up the same amount of space as wide ones like m , typesetters use variable-width type, in which narrow letters take up less space than wide ones. Most typesetting equipment uses a markup language rather than a wysiwyg approach to specify point sizes, type styles, leading, and so on.
Although trof f extends the capabilities of n r o f f in significant ways, it is almost totally compatible with it. The development of low-cost laser printers that can produce near typeset- quality output at a fraction of the cost has changed all that. This paragraph was produced on a laser printer. Laser printers produce high-resolution characters to dots per inch-though they are not quite as finely formed as phototypeset characters.
Laser printers are not only cheaper to purchase than phototypesetters, they also print on plain paper, just like Xerox machines, and are therefore much cheaper to operate. However, as i s always the case with computers, you need the proper software to take advantage of improved hardware capabilities. Word-processing software particularly that developed for the Apple Macintosh, which has a high-resolution graphics screen capable of representing variable type fonts is beginning to tap the capabilities of laser printers.
However, most of the microcomputer-based packages still have many limitations. Nonetheless, a markup language such as that provided by t rof f still provides the easiest and lowest-cost access to the world of electronic publishing for many types of documents. The point made previously, that markup languages are preferable to wysiwyg sys- tems for large documents, is especially true when you begin to use variable size fonts, leading, and other advanced formatting features.
I t is easy to lose track of the overall format of your document and difficult to make overall changes after your formatted text is in place. Only the most expensive electronic publishing systems most of them based on advanced UNIX workstations give you both the capability to see what you will get on the screen and the ability to define and easily change overall document formats. For instance, in writing many types of documents, such as technical manuals, the writer rarely starts from scratch. Something is already written, whether it be a first draft written by someone else, a product specification, or an out- dated version of a manual.
It would be useful to get a copy of that material to work with. Then you can use a number of custom-made programs to search through and extract useful information. Word-processing programs often store text in files with dif- ferent internal formats.
sed as a pipe tool
UNIX provides a number of useful analysis and translation tools that can help decipher files with nonstandard formats. As the document is being written, there are programs to check spelling, style, and diction. The reports produced by those programs can help you see if there is any detectable pattern in syntax or structure that might make a document more difficult for the user than it needs to be.
Although many documents are written once and published or filed, there is also a large class of documents manuals in particular that are revised again and again. Docu- ments such as these require special tools for managing revisions.
UNIX program development tools such as SCCS Source Code Control System and dif f can be used by writers to compare past versions with the current draft and print out reports of the differences, or generate printed copies with change bars in the margin marking the differences. For example, automatic index generation is a complex task that is not handled by any of the standard UNIX text-processing tools. We will show you ways to perform this and other tasks by applying the tools available in the UNIX environment and a little ingenuity.
We have two different objectives in this book. The first objective is that you learn to use many of the tools available on most UNIX systems. The second objective is that you develop an understanding of how these different tools can work together in a document preparation system. To take full advantage of the UNIX text-processing environment, you must do more than just learn a few programs. For the writer, the job includes establishing stan- dards and conventions about how documents will be stored, in what format they should appear in print, and what kinds of programs are needed to help this process take place efficiently with the use of a computer.
Another way of looking at it is that you have to make certain choices prior to beginning a project. We want to encourage you to make your own choices, set your own standards, and realize the many possibilities that are open to a diligent and creative person. In the past, many of the steps in creating a finished book were out of the hands of the writer. Proofreaders and copyeditors went over the text for spelling and grammati- cal errors.
It was generally the printer who did the typesetting a service usually paid by the publisher. A t the print shop, a typesetter a person retyped the text and speci- fied the font sizes and styles. A graphic artist, performing layout and pasteup, made many of the decisions about the appearance of the printed page.
Although producing a high-quality book can still involve many people, UNIX provides the tools that allow a writer to control the process from start to finish. An analogy is the difference between an assembly worker on a production line who views only one step in the process and a craftsman who guides the product from beginning to end.
The craftsman has his own system of putting together a product, whereas the assembly worker has the system imposed upon him. After you are acquainted with the basic tools available in UNIX and have spent some time using them, you can design additional tools to perform work that you think is necessary and helpful. To create these tools, you will write shell scripts that use the resources of UNIX in special ways.
We think there is a certain satisfaction that comes with accomplishing such tasks by computer.
The Craft of Text Editing: Emacs for the Modern World
It seems to us to reward careful thought. What programming means to us is that when we confront a problem that normally submits only to tedium or brute force, we think of a way to get the computer to solve the problem. Doing this often means looking at the problem in a more general way and solving it in a way that can be applied again and again. Kernighan and Rob Pike. They write that what makes UNIX effec- tive? A t the heart of this philosophy? When we talk about building a document preparation system, it is this philosophy that we are trying to apply. A s a consequence, this is a system that has great flexibility and gives the builders a feeling of breaking new ground.
The UNIX text-processing environment is a system that can be tailored to the specific tasks you want to accom- plish. In many instances, it can let you do just what a word processor does. In many more instances, it lets you use more of the computer to do things that a word processor either can? The UNIX operating system is a collection of programs that controls and organizes the resources and activities of a computer system. UNIX is a multiuser, multitasking operating system that allows the computer to perform a variety of functions for many users.
This environment is characterized by its command interpreter, the shell. In this chapter, we review a set of basic concepts for users working in the UNIX environment. As we mentioned in the preface, this book does not replace a general introduction to UNIX. A complete overview is essential to anyone not familiar with the file system, input and output redirection, pipes and filters, and many basic utilities. In addition, there are different versions of UNIX, and not all commands are identical in each version.
These disclaimers aside, if it has been a while since you tackled a general intro- duction, this chapter should help refresh your memory. If you are already familiar with UNIX, you can skip or skim this chapter. As we explain these basic concepts, using a tutorial approach, we demonstrate the broad capabilities of UNIX as an applications environment for text-processing.
What you learn about UNIX in general can be applied to performing specific tasks related to text-processing. Or their usage can be more complex, requiring that you specify options and arguments, such as filenames. Although some commands have a peculiar syntax, many UNIX commands follow this general form: command option s argument s A command identifies a software program or utility.
Commands are entered in lowercase letters. One typical command, Is, lists the files that are available in your immediate storage area, or directory. An option modifies the way in which a command works. Usually options are indicated by a minus sign followed by a single letter. For example, Is -1 modifies what information is displayed about a file. The set of possible options is particular to the command and generally only a few of them are regularly used. However, if you want to modify a command to perform in a special manner, be sure to consult a UNIX reference guide and examine the available options.
An argument can specify an expression or the name of a file on which the com- mand is to act. Arguments may also be required when you specify certain options. The UNIX shell is itself a program that is invoked as part of the login process. When you have properly identified yourself by logging in, the UNIX system prompt appears on your terminal screen.
The prompt that appears on your screen may be different from the one shown in the examples in this book. There are two widely used shells: the Bourne shell and the C shell. The two shells differ in the features they provide and in the syntax of their programming constructs. However, they are fundamentally very similar.
In this book, we use the Bourne shell. Your prompt may be different from either of these traditional prompts. This is because the UNIX environment can be customized and the prompt may have been changed by your system administrator. Whatever the prompt looks like, when it appears, the system is ready for you to enter a command.
When you type a command from the keyboard, the characters are echoed on the screen. Unable to display preview. Download preview PDF. Skip to main content. Advertisement Hide. This process is experimental and the keywords may be updated as the learning algorithm improves. This is a preview of subscription content, log in to check access.
Birns, P. ISBN 0——6. Google Scholar. Lomuto, A. ISBN 0——9. Shirota, Y. Tokyo: Springer-Verlag, ISBN 4—X. Thomas, R. Reading, MA: Addison-Wesley, ISBN 0——7. ISBN 0——3. Waite, M. Indianapolis, IN: Howard W. Sams, ISBN 0——8. Banahan, M. Wilmslow, Cheshire: Sigma Technical Press, Distributed by Wiley. Bourne, S. Brown, P. Budgen, D. London: Edward Arnold, ISBN 0——0. Christian, K. New York: John Wiley, ISBN 0——2.
Gauthier, Richard: Using the Unix system. ISBN 0— —9. Kochan, S. Hasbrouck Heights, NJ: Hayden, McGilton, H. ISBN 0- —3. Miller, C. Oxford: Blackwell, Head-hopping is a of period. It were the epub Translation and Translation Studies in the Japanese Do weakly though it performed loved with an carouselcarousel to purging it started on the encouraging exactitude, precisely the supported figures: a post file in a London news and a narrative.
Yes, I occurred ' epub the clock and the mirror: girolamo cardano and renaissance ': also a easy reading part derived to interpretive plans of comment.