
FliO'l HEWLETT ~I.:. PACKARD Text Editors and Processors HP-UX Concepts and Tutorials Text Editors and Processors HP-UX Concepts and Tutorials HP Part Number 97089-90022 Copyright 1986 Hewlett-Packard Company This document contains proprietary information which is protected by copyright. All rights are reserved. No part of this document may be photocopied, reproduced or translated to another language without the prior written consent of Hewlett­ Packard Company. The information contained in this document is subject to change without notice. Restricted Rights Legend Use, duplication or disclosure by the Government is subject to restrictions as set forth in paragraph (b)(3)(B) of the Rights in Technical Data and Software clause in DAR 7-104.9(a). Copyright 1980,1984, AT&T, Inc. Copyright 1979, 1980, 1983, The Regents of the University of California. This software and documentation is based in part on the Fourth Berkeley Software Distribution under license from the Regents of the University of California. Hewlett-Packard Company 3404 East Harmony Road, Fort Collins, Colorado 80525 Printing History New editions of this manual will incorporate all material updated since the previous edition. Update packages may be issued between editions and contain replacement and additional pages to be merged into the manual by the user. Each updated page will be indicated by a revision date at the bottom of the page. A vertical bar in the margin indicates the changes on each page. Note that pages which are rearranged due to changes on a previous page are not considered revised. The manual printing date and part number indicate its current edition. The printing date changes when a new edition is printed. (Minor corrections and updates which are incorporated at reprint do not cause the date to change.) The manual part number changes when extensive technical changes are incorporated. August 1986 ... Edition 1 NOTICE The information contained in this document is subject to change without notice. HEWLETT-PACKARD MAKES NO WARRANTY OF ANY KIND WITH REGARD TO THIS MANUAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Hewlett-Packard shall not be liable for errors contained herein or direct, indirect, special, incidental or consequential damages in connection with the furnishing, performance, or use of this materiaL WARRANTY A copy of the specific warranty terms applicable to your Hewlett-Packard product and replacement parts can be obtained from your local Sales and Service Office. ii Table of Contents Edit: An Interactive Editor Introduction . .. 1 Session 1: Creating a Text File. .. 2 Asking for edit. .. 3 Creating Text. .. 4 Messages from edit. .. 4 Text Input Mode . .. 4 Writing Text to Disc .......................................................... 5 Logging Off ................................................................ 6 Session 2 ...................................................................... 6 Adding More Text to the File. .. 6 Interrupt . .. 7 Making Corrections. .. 7 Listing Buffer Contents. .. 7 Finding Things in the Buffer. .. 8 The Current Line ............................................................ 9 Numbering Lines (nu). .. 9 Substitute Com and (5) . .. 9 Another Way to List What's in the Buffer (z) . ................................... 11 Saving the Modified Text. .. 11 Session 3 . .. 12 Bringing Text Into the Buffer (e) . .. 12 Moving Text in the Buffer (m) ................................................ 12 Copying Lines (copy) . ...................................................... 13 Deleting Lines (d) .......................................................... 13 Be Careful . .. 14 Oops! I goofed. Now What? (undo) ........................................... 15 More About Dot (.) and Buffer End ($) ........................................ 15 Moving Around in the Buffer (+ and -) ....................................... 16 Changing Lines (c) ......................................................... 16 Session 4 . .. 17 Making Commands Global (g) ............................................... 17 More About Searching and Substituting ........................................ 18 Special Characters. .. 19 Issuing HP-UX Commands from the Editor ..................................... 20 Filenames and File Manipulation. .. 20 The File ( f) Command . .. 20 Reading Additional Files (r) .................................................. 21 Writing Parts of the Buffer ................................................... 21 Recovering Files ........................................................... 21 Other Recovery Techniques ................................................. 21 Further Reading and Information . .. 22 Using ex . ................................................................. 22 ii Edit An Interactive Editor Introduction Text editors are special computer programs that enable you to easily create, preserve, modify, and print text by use of a computer and terminal. Creating text is very much like typing on an electric typewriter. Modifying text involves telling the text editor what to add, change, insert, or delete. Text is printed by giving a command to print all or part of the text file contents. You can also provide special instructions to control the output format if you desire. This tutorial is divided into four lessons, and assumes no prior familiarity with computers or with text editing. A series of text editing sessions lead you through the basic steps of creating and revising a text file. After scanning each lesson but before beginning the next, try the examples at a terminal to get a feeling for the actual process of text editing. Allow time for experimentation, and you can qUickly learn to use a computer for writing and modifying text. Other HP-UX features are useful besides the text editor. These features are discussed in the book Introducing the UNIX System as well as in other tutorials that provide a general introduction to the system. As soon as you are familiar with your terminal keyboard, its special keys, the system login procedure, and know how to correct typing errors, you are ready to start. Let's first define some terms: Program A group of computer instructions that defines the sequence of steps to be performed by the computer in order to accomplish a specific task. For example, a series of steps to balance your checkbook is a program. HP-UX A special type of program called an operating system that supervises the computer, peripheral devices, and all programs that use the HP-UX operating system. Edit The name of the HP-UX text editor that you will be learning to use; a program that aids you in writing or revising text. Edit was designed for beginning users, and is a simplified version of a more extensive editor named ex. File Each HP-UX account is allotted disc storage space for permanent storage of in­ formation such as programs, data, or text. A file is a logical collection of data (such as an essay, a program, or a chapter from a book) that is stored and maintained by a computer system. Once you create a file it is kept until you tell the system to remove it. You can create a file during one HP-UX session, log out, then return to use it at a later time. Files contain anything you choose to write and store in them. File sizes vary, depending on individual needs. One file might contain a single number, while another could contain a very long document or program. The only way to save information from one session to the next is to store it in a file where it is kept for later use. 1 Filename Filenames are used to distinguish one file from another, serving the same purpose as labels on manila folders in a file cabinet. To write or access information in a file, use the name of that file in an HP-UX command. The system automatically determines where the file is located. Disc Files are stored on a thin circular disc that is coated with magnetic particles similar to magnetic recording tape. The disc may be permanently installed in a disc drive, or it may be a removable flexible disc that resembes a small phonograph record in a thin, square protective container or envelope. Information from the computer (such as your text) is recorded on the disc surface by the disc drive. Buffer A temporary work space that is available to the user during a text editing session. The buffer is used to build and modify text files. Buffers are analagous to a piece of scratch paper that is discarded at the end of a session after the information it contained has been copied (written) to a permanent disc file. Session 1: Creating a Text File Before you can use the editor, you must first log onto the computer so HP-UX can set up communication between your terminal and the editor program. Here is a review of the standard HP-UX login procedure: If the terminal you are using is directly linked to the computer, turn it on and press (Return)). If your terminal uses an acoustic coupler (or modem) and telephone line instead, turn on the terminal, dial the system-access telephone number, then, when you hear a high-pitched tone, place the tele­ phone receiver in the acoustic coupler. If you are using a modem, consult the modem manual for procedures. Press carriage return (or the ( Return) key) once, and await the login message: Type your login name (which identifies you to HP-UX) on the same line as the login message, then press ( Return). If the keyboard on your terminal supports both uppercase and lowercase, be sure you enter your login name in lowercase. Otherwise,
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages187 Page
-
File Size-