diff options
Diffstat (limited to 'usr/src/man/man1/ed.1')
| -rw-r--r-- | usr/src/man/man1/ed.1 | 176 |
1 files changed, 29 insertions, 147 deletions
diff --git a/usr/src/man/man1/ed.1 b/usr/src/man/man1/ed.1 index cb22999587..922aaa12bf 100644 --- a/usr/src/man/man1/ed.1 +++ b/usr/src/man/man1/ed.1 @@ -1,13 +1,13 @@ '\" te .\" Copyright 1989 AT&T Copyright (c) 2003, Sun Microsystems, Inc. Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved -.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at +.\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at .\" http://www.opengroup.org/bookstore/. .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html. .\" This notice shall appear on any product containing this material. .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH ed 1 "10 Dec 2003" "SunOS 5.11" "User Commands" +.TH ED 1 "Dec 10, 2003" .SH NAME ed, red \- text editor .SH SYNOPSIS @@ -125,23 +125,22 @@ follows: .sp .TS -tab() box; -cw(2.75i) |cw(2.75i) -lw(2.75i) |lw(2.75i) -. -SpecifiedResulting +box; +c | c +l | l . +Specified Resulting _ -,1 , $ +, 1 , $ _ -, addr1 , addr +, addr 1 , addr _ -addr ,addr , addr +addr , addr , addr _ -;1 ; $ +; 1 ; $ _ -; addr1 ; addr +; addr 1 ; addr _ -addr ;addr ; addr +addr ; addr ; addr .TE .sp @@ -197,7 +196,6 @@ numbered or written, respectively, as discussed below under the \fBl\fR, \fBn\fR, and \fBp\fR commands. .sp .ne 2 -.mk .na \fB\fB(.)a\fR\fR .ad @@ -210,7 +208,6 @@ numbered or written, respectively, as discussed below under the \fBl\fR, \fB\fB\&.\fR\fR .ad .RS 11n -.rt The \fBa\fRppend command accepts zero or more lines of text and appends it after the addressed line in the buffer. The current line (\fB\&.\fR) is left at the last inserted line, or, if there were none, at the addressed line. Address @@ -221,7 +218,6 @@ entered from a terminal is 256 per line (including the new-line character). .sp .ne 2 -.mk .na \fB\fB(.,.)c\fR\fR .ad @@ -234,7 +230,6 @@ entered from a terminal is 256 per line (including the new-line character). \fB\fB\&.\fR\fR .ad .RS 11n -.rt The \fBc\fRhange command deletes the addressed lines from the buffer, then accepts zero or more lines of text that replaces these lines in the buffer. The current line (\fB\&.\fR) is left at the last line input, or, if there were @@ -244,23 +239,19 @@ address of the new last line. If no lines remain in the buffer, the current line number will be set to 0. .sp .ne 2 -.mk .na \fB\fB/usr/xpg4/bin/ed\fR\fR .ad .RS 20n -.rt Address 0 is not legal for this command. .RE .sp .ne 2 -.mk .na \fB\fB/usr/xpg6/bin/ed\fR\fR .ad .RS 20n -.rt Address 0 is valid for this command. It is interpreted as if the address 1 were specified. .RE @@ -269,12 +260,10 @@ specified. .sp .ne 2 -.mk .na \fB\fBC\fR\fR .ad .RS 11n -.rt Same as the \fBX\fR command, described later, except that \fBed\fR assumes all text read in for the \fBe\fR and \fBr\fR commands is encrypted unless a null key is typed in. @@ -282,12 +271,10 @@ key is typed in. .sp .ne 2 -.mk .na \fB\fB(.,.)d\fR\fR .ad .RS 11n -.rt The \fBd\fRelete command deletes the addressed lines from the buffer. The line after the last line deleted becomes the current line. If the lines deleted were originally at the end of the buffer, the new last line becomes the current @@ -297,12 +284,10 @@ line. If no lines remain in the buffer, the current line number will be set to .sp .ne 2 -.mk .na \fB\fBe\fR \fIfile\fR\fR .ad .RS 11n -.rt The \fBe\fRdit command deletes the entire contents of the buffer and then reads the contents of \fIfile\fR into the buffer. The current line (\fB\&.\fR) is set to the last line of the buffer. If \fIfile\fR is not given, the currently @@ -324,12 +309,10 @@ previously. .sp .ne 2 -.mk .na \fB\fBE\fR \fIfile\fR\fR .ad .RS 11n -.rt The \fBE\fRdit command is like \fBe\fR, except that the editor does not check to see if any changes have been made to the buffer since the last \fBw\fR command. @@ -337,12 +320,10 @@ command. .sp .ne 2 -.mk .na \fB\fBf\fR \fIfile\fR\fR .ad .RS 11n -.rt If \fIfile\fR is given, the \fBf\fR command changes the currently remembered path name to \fIfile\fR. Whether the name is changed or not, the \fBf\fR command then writes the (possibly new) currently remembered path name to the @@ -355,12 +336,10 @@ The current line number is unchanged. .sp .ne 2 -.mk .na \fB\fB(1,$)g/\fR\fIRE\fR\fB/\fR\fIcommand list\fR\fR .ad .RS 26n -.rt In the \fBg\fRlobal command, the first step is to mark every line that matches the given \fIRE\fR. Then, for every such line, the given \fIcommand list\fR is executed with the current line (\fB\&.\fR) initially set to that line. When the @@ -382,12 +361,10 @@ if it is preceded by a backslash. .sp .ne 2 -.mk .na \fB\fB(1,$)G/\fR\fIRE\fR\fB/\fR\fR .ad .RS 26n -.rt In the interactive \fBG\fRlobal command, the first step is to mark every line that matches the given \fIRE\fR. Then, for every such line, that line is written to standard output, the current line (\fB\&.\fR) is changed to that @@ -411,24 +388,20 @@ used as a literal character if it is preceded by a backslash. .sp .ne 2 -.mk .na \fB\fBh\fR\fR .ad .RS 26n -.rt The \fBhelp\fR command gives a short error message that explains the reason for the most recent \fB?\fR diagnostic. The current line number is unchanged. .RE .sp .ne 2 -.mk .na \fB\fBH\fR\fR .ad .RS 26n -.rt The \fBHelp\fR command causes \fBed\fR to enter a mode in which error messages are written for all subsequent \fB?\fR diagnostics. It also explains the previous \fB?\fR if there was one. The \fBH\fR command alternately turns this @@ -437,7 +410,6 @@ mode on and off; it is initially off. The current line number is unchanged. .sp .ne 2 -.mk .na \fB\fB(.,.)i\fR\fR .ad @@ -450,7 +422,6 @@ mode on and off; it is initially off. The current line number is unchanged. \fB\fB\&.\fR\fR .ad .RS 26n -.rt The \fBinsert\fR command accepts zero or more lines of text and inserts it before the addressed line in the buffer. The current line (\fB\&.\fR) is left at the last inserted line, or, if there were none, at the addressed line. This @@ -459,23 +430,19 @@ text. The maximum number of characters that may be entered from a terminal is 256 per line (including the new-line character). .sp .ne 2 -.mk .na \fB\fB/usr/xpg4/bin/ed\fR\fR .ad .RS 20n -.rt Address 0 is not legal for this command. .RE .sp .ne 2 -.mk .na \fB\fB/usr/xpg6/bin/ed\fR\fR .ad .RS 20n -.rt Address 0 is valid for this command. It is interpreted as if the address 1 were specified. .RE @@ -484,12 +451,10 @@ specified. .sp .ne 2 -.mk .na \fB\fB(.,.+1)j\fR\fR .ad .RS 26n -.rt The \fBj\fRoin command joins contiguous lines by removing the appropriate new-line characters. If exactly one address is given, this command does nothing. If lines are joined, the current line number is set to the address of @@ -498,12 +463,10 @@ the joined line. Otherwise, the current line number is unchanged. .sp .ne 2 -.mk .na \fB\fB(.)k\fR\fIx\fR\fR .ad .RS 26n -.rt The mar\fBk\fR command marks the addressed line with name \fIx\fR, which must be an ASCII lower-case letter (\fBa\fR\fB-\fR\fBz\fR). The address \fI a\'x\fR then addresses this line. The current line (\fB\&.\fR) is unchanged. @@ -511,12 +474,10 @@ then addresses this line. The current line (\fB\&.\fR) is unchanged. .sp .ne 2 -.mk .na \fB\fB(.,.)l\fR\fR .ad .RS 26n -.rt The \fBl\fR command writes to standard output the addressed lines in a visually unambiguous form. The characters ( \fB\e\e\fR, \fB\ea\fR, \fB\eb\fR, \fB\ef\fR, \fB\er\fR, \fB\et\fR, \fB\ev\fR) are written as the corresponding escape @@ -538,12 +499,10 @@ the last line written. .sp .ne 2 -.mk .na \fB\fB(.,.)m\fR\fIa\fR\fR .ad .RS 26n -.rt The \fBm\fRove command repositions the addressed line(s) after the line addressed by \fIa\fR. Address 0 is legal for \fIa\fR and causes the addressed line(s) to be moved to the beginning of the file. It is an error if address @@ -553,12 +512,10 @@ left at the last line moved. .sp .ne 2 -.mk .na \fB\fB(.,.)n\fR\fR .ad .RS 26n -.rt The \fBn\fRumber command writes the addressed lines, preceding each line by its line number and a tab character. The current line (\fB\&.\fR) is left at the last line written. The \fBn\fR command may be appended to any command other @@ -567,12 +524,10 @@ than \fBe\fR, \fBE\fR, \fBf\fR, \fBq\fR, \fBQ\fR, \fBr\fR, \fBw\fR, or \fB!\fR. .sp .ne 2 -.mk .na \fB\fB(.,.)p\fR\fR .ad .RS 26n -.rt The \fBp\fRrint command writes the addressed lines to standard output. The current line (\fB\&.\fR) is left at the last line written. The \fBp\fR command may be appended to any command other than \fBe\fR, \fBE\fR, \fBf\fR, \fBq\fR, @@ -582,12 +537,10 @@ current line and writes the new current line. .sp .ne 2 -.mk .na \fB\fBP\fR\fR .ad .RS 26n -.rt The \fBP\fR command causes \fBed\fR to prompt with an asterisk (\fB*\fR) (or \fIstring\fR, if \fB-p\fR is specified) for all subsequent commands. The \fBP\fR command alternatively turns this mode on and off; it is initially on if @@ -596,12 +549,10 @@ the \fB-p\fR option is specified, otherwise off. The current line is unchanged. .sp .ne 2 -.mk .na \fB\fBq\fR\fR .ad .RS 26n -.rt The \fBq\fRuit command causes \fBed\fR to exit. If the buffer has changed since the last time the entire buffer was written, the user is warned. See DIAGNOSTICS. @@ -609,24 +560,20 @@ DIAGNOSTICS. .sp .ne 2 -.mk .na \fB\fBQ\fR\fR .ad .RS 26n -.rt The editor exits without checking if changes have been made in the buffer since the last \fBw\fR command. .RE .sp .ne 2 -.mk .na \fB\fB($)r\fR \fIfile\fR\fR .ad .RS 26n -.rt The \fBr\fRead command reads the contents of \fIfile\fR into the buffer. If \fIfile\fR is not given, the currently remembered file name, if any, is used (see the \fBe\fR and \fBf\fR commands). The currently remembered file name is @@ -652,7 +599,6 @@ current directory to the end of the file being edited. Such a shell command is .sp .ne 2 -.mk .na \fB\fB(.,.)s/\fR\fIRE\fR\fB/\fR\fIreplacement\fR\fB/\fR\fR .ad @@ -725,24 +671,20 @@ if the replacement string is identical to the string that it replaces. The substitute command supports the following indicators: .sp .ne 2 -.mk .na \fB\fIcount\fR\fR .ad .RS 9n -.rt Substitute for the \fIcount\fRth occurrence only of the \fIRE\fR found on each addressed line. \fIcount\fR must be between \fB1\fR-\fB2047\fR. .RE .sp .ne 2 -.mk .na \fB\fBg\fR\fR .ad .RS 9n -.rt Globally substitute for all non-overlapping instances of the \fIRE\fR rather than just the first one. If both \fBg\fR and \fIcount\fR are specified, the results are unspecified. @@ -750,36 +692,30 @@ results are unspecified. .sp .ne 2 -.mk .na \fB\fBl\fR\fR .ad .RS 9n -.rt Write to standard output the final line in which a substitution was made. The line is written in the format specified for the \fBl\fR command. .RE .sp .ne 2 -.mk .na \fB\fBn\fR\fR .ad .RS 9n -.rt Write to standard output the final line in which a substitution was made. The line is written in the format specified for the \fBn\fR command. .RE .sp .ne 2 -.mk .na \fB\fBp\fR\fR .ad .RS 9n -.rt Write to standard output the final line in which a substitution was made. The line will be written in the format specified for the \fBp\fR command. .RE @@ -788,7 +724,6 @@ line will be written in the format specified for the \fBp\fR command. .sp .ne 2 -.mk .na \fB\fB(.,.)t\fR\fIa\fR\fR .ad @@ -801,7 +736,6 @@ current line (\fB\&.\fR) is left at the last line copied. .sp .ne 2 -.mk .na \fB\fBu\fR\fR .ad @@ -820,7 +754,6 @@ started. .sp .ne 2 -.mk .na \fB\fB(1,$)v/\fR\fIRE\fR\fB/\fR\fIcommand list\fR\fR .ad @@ -832,7 +765,6 @@ marked during the first step are those that do \fBnot\fR match the \fIRE\fR. .sp .ne 2 -.mk .na \fB\fB(1,$)V/\fR\fIRE\fR\fB/\fR\fR .ad @@ -845,7 +777,6 @@ match the \fIRE\fR. .sp .ne 2 -.mk .na \fB\fB(1,$)w\fR \fIfile\fR\fR .ad @@ -878,12 +809,10 @@ command that wrote the entire buffer''. .sp .ne 2 -.mk .na \fB\fB(1,$)W\fR \fIfile\fR\fR .ad .RS 19n -.rt This command is the same as the \fBw\fRrite command above, except that it appends the addressed lines to the end of \fIfile\fR if it exists. If \fIfile\fR does not exist, it is created as described above for the \fBw\fR @@ -892,12 +821,10 @@ command. .sp .ne 2 -.mk .na \fB\fBX\fR\fR .ad .RS 19n -.rt An educated guess is made to determine whether text read for the \fBe\fR and \fBr\fR commands is encrypted. A null key turns off encryption. Subsequent \fBe\fR, \fBr\fR, and \fBw\fR commands will use this key to encrypt or decrypt @@ -907,12 +834,10 @@ option of \fBed\fR. .sp .ne 2 -.mk .na \fB\fB($)=\fR\fR .ad .RS 19n -.rt The line number of the addressed line is written to standard output in the following format: .sp @@ -928,12 +853,10 @@ The current line number is unchanged by this command. .sp .ne 2 -.mk .na \fB\fB!\fR\fIshell command\fR\fR .ad .RS 19n -.rt The remainder of the line after the \fB!\fR is sent to the UNIX system shell (see \fBsh\fR(1)) to be interpreted as a command. Within the text of that command, the unescaped character \fB%\fR is replaced with the remembered file @@ -951,12 +874,10 @@ The current line number is unchanged. .sp .ne 2 -.mk .na \fB\fB(.+1)\fR<new-line>\fR .ad .RS 19n -.rt An address alone on a line causes the addressed line to be written. A new-line alone is equivalent to \fB\&.+1p\fR. It is useful for stepping forward through the buffer. The current line number will be set to the address of the written @@ -973,24 +894,20 @@ The \fBed\fR utility takes the standard action for all signals with the following exceptions: .sp .ne 2 -.mk .na \fB\fBSIGINT\fR\fR .ad .RS 10n -.rt The \fBed\fR utility interrupts its current activity, writes the string "\fB?\en\fR" to standard output, and returns to command mode. .RE .sp .ne 2 -.mk .na \fB\fBSIGHUP\fR\fR .ad .RS 10n -.rt If the buffer is not empty and has changed since the last write, the \fBed\fR utility attempts to write a copy of the buffer in a file. First, the file named \fBed.hup\fR in the current directory is used. If that fails, the file named @@ -1020,34 +937,28 @@ may be omitted, in which case the addressed line is written. The following pairs of commands are equivalent: .sp .ne 2 -.mk .na \fB\fBs/s1/s2\fR\fR .ad .RS 11n -.rt \fBs/s1/s2/p\fR .RE .sp .ne 2 -.mk .na \fB\fBg/s1\fR\fR .ad .RS 11n -.rt \fBg/s1/p\fR .RE .sp .ne 2 -.mk .na \fB\fB?s1\fR\fR .ad .RS 11n -.rt \fB?s1?\fR .RE @@ -1065,12 +976,10 @@ current line number unchanged. .SH OPTIONS .sp .ne 2 -.mk .na \fB\fB-C\fR\fR .ad .RS 13n -.rt Encryption option. The same as the \fB-x\fR option, except that \fBed\fR simulates a \fBC\fR command. The \fBC\fR command is like the \fBX\fR command, except that all text read in is assumed to have been encrypted. @@ -1078,24 +987,20 @@ except that all text read in is assumed to have been encrypted. .sp .ne 2 -.mk .na \fB\fB\fR\fB-p\fR\fIstring\fR \fR .ad .RS 13n -.rt Allows the user to specify a prompt string. By default, there is no prompt string. .RE .sp .ne 2 -.mk .na \fB\fB-s\fR | \fB-;\fR\fR .ad .RS 13n -.rt Suppresses the writing of character counts by \fBe\fR, \fBr\fR, and \fBw\fR commands, of diagnostics from \fBe\fR and \fBq\fR commands, and of the \fB!\fR prompt after a \fB!\fR\fIshell command\fR. @@ -1103,12 +1008,10 @@ prompt after a \fB!\fR\fIshell command\fR. .sp .ne 2 -.mk .na \fB\fB-x\fR\fR .ad .RS 13n -.rt Encryption option. When \fB-x\fR is used, \fBed\fR simulates an \fBX\fR command and prompts the user for a key. The \fBX\fR command makes an educated guess to determine whether text read in is encrypted or not. The temporary buffer file @@ -1122,12 +1025,10 @@ is encrypted also, using a transformed version of the key typed in for the The following operand is supported: .sp .ne 2 -.mk .na \fB\fIfile\fR\fR .ad .RS 8n -.rt If \fIfile\fR is specified, \fBed\fR simulates an \fBe\fR command on the file named by the path name \fIfile\fR before accepting commands from the standard input. @@ -1151,59 +1052,49 @@ that affect the execution of \fBed\fR: \fBHOME\fR, \fBLANG\fR, \fBLC_ALL\fR, The following exit values are returned: .sp .ne 2 -.mk .na \fB\fB0\fR\fR .ad .RS 6n -.rt Successful completion without any file or command errors. .RE .sp .ne 2 -.mk .na \fB\fB>0\fR\fR .ad .RS 6n -.rt An error occurred. .RE .SH FILES .sp .ne 2 -.mk .na \fB\fB$TMPDIR\fR\fR .ad .RS 12n -.rt If this environment variable is not \fINULL\fR, its value is used in place of \fB/var/tmp\fR as the directory name for the temporary work file. .RE .sp .ne 2 -.mk .na \fB\fB/var/tmp\fR\fR .ad .RS 12n -.rt If \fB/var/tmp\fR exists, it is used as the directory name for the temporary work file. .RE .sp .ne 2 -.mk .na \fB\fB/tmp\fR\fR .ad .RS 12n -.rt If the environment variable \fBTMPDIR\fR does not exist or is \fINULL,\fR and if \fB/var/tmp\fR does not exist, then \fB/tmp\fR is used as the directory name for the temporary work file. @@ -1211,12 +1102,10 @@ for the temporary work file. .sp .ne 2 -.mk .na \fB\fBed.hup\fR\fR .ad .RS 12n -.rt Work is saved here if the terminal is hung up. .RE @@ -1229,13 +1118,12 @@ See \fBattributes\fR(5) for descriptions of the following attributes: .sp .TS -tab() box; -cw(2.75i) |cw(2.75i) -lw(2.75i) |lw(2.75i) -. -ATTRIBUTE TYPEATTRIBUTE VALUE +box; +c | c +l | l . +ATTRIBUTE TYPE ATTRIBUTE VALUE _ -CSIEnabled +CSI Enabled .TE .SS "/usr/xpg4/bin/ed" @@ -1243,15 +1131,14 @@ CSIEnabled .sp .TS -tab() box; -cw(2.75i) |cw(2.75i) -lw(2.75i) |lw(2.75i) -. -ATTRIBUTE TYPEATTRIBUTE VALUE +box; +c | c +l | l . +ATTRIBUTE TYPE ATTRIBUTE VALUE _ -CSIEnabled +CSI Enabled _ -Interface StabilityStandard +Interface Stability Standard .TE .SS "/usr/xpg6/bin/ed" @@ -1259,15 +1146,14 @@ Interface StabilityStandard .sp .TS -tab() box; -cw(2.75i) |cw(2.75i) -lw(2.75i) |lw(2.75i) -. -ATTRIBUTE TYPEATTRIBUTE VALUE +box; +c | c +l | l . +ATTRIBUTE TYPE ATTRIBUTE VALUE _ -CSIEnabled +CSI Enabled _ -Interface StabilityStandard +Interface Stability Standard .TE .SH SEE ALSO @@ -1280,23 +1166,19 @@ Interface StabilityStandard .SH DIAGNOSTICS .sp .ne 2 -.mk .na \fB\fB?\fR\fR .ad .RS 9n -.rt for command errors. .RE .sp .ne 2 -.mk .na \fB\fB?\fR\fIfile\fR\fR .ad .RS 9n -.rt for an inaccessible file. Use the \fBh\fRelp and \fBH\fRelp commands for detailed explanations. .RE |
