7139 Sync mDNS with mDNSResponder-625.41.2
[unleashed.git] / usr / src / man / man1has / ex.1has
bloba3ffd0b6a01c7cf8bf108bdcb55650be81e1a2cd
1 '\" te
2 .\" Copyright 1989 AT&T
3 .\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserve
4 .\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
5 .\" 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
6 .\" http://www.opengroup.org/bookstore/.
7 .\" 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.
8 .\"  This notice shall appear on any product containing this material.
9 .\" 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.
10 .\" 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.
11 .\" 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]
12 .TH EX 1HAS "Jun 15, 2004"
13 .SH NAME
14 ex \- text editor
15 .SH SYNOPSIS
16 .LP
17 .nf
18 \fB/usr/bin/ex\fR [\fB-|\fR \fB-s\fR] [\fB-l\fR] [\fB-L\fR] [\fB-R\fR] [\fB-r\fR [\fIfile\fR]] [\fB-t\fR \fItag\fR]
19      [\fB-v\fR] [\fB-V\fR] [\fB-x\fR] [\fB-w\fR\fIn\fR] [\fB-C\fR] [+\fIcommand\fR | \fB-c\fR \fIcommand\fR] \fIfile\fR...
20 .fi
22 .LP
23 .nf
24 \fB/usr/xpg4/bin/ex\fR [\fB-|\fR \fB-s\fR] [\fB-l\fR] [\fB-L\fR] [\fB-R\fR] [\fB-r\fR [\fIfile\fR]]
25      [\fB-t\fR \fItag\fR] [\fB-v\fR] [\fB-V\fR] [\fB-x\fR] [\fB-w\fR\fIn\fR] [\fB-C\fR]
26      [+\fIcommand\fR | \fB-c\fR \fIcommand\fR] \fIfile\fR...
27 .fi
29 .LP
30 .nf
31 \fB/usr/xpg6/bin/ex\fR [\fB-|\fR \fB-s\fR] [\fB-l\fR] [\fB-L\fR] [\fB-R\fR] [\fB-r\fR [\fIfile\fR]]
32      [\fB-t\fR \fItag\fR] [\fB-v\fR] [\fB-V\fR] [\fB-x\fR] [\fB-w\fR\fIn\fR] [\fB-C\fR]
33      [+\fIcommand\fR | \fB-c\fR \fIcommand\fR] \fIfile\fR...
34 .fi
36 .SH DESCRIPTION
37 .sp
38 .LP
39 The \fBex\fR utility is the root of a family of editors: \fBex\fR and \fBvi\fR.
40 \fBex\fR is a superset of \fBed\fR(1), with the most notable extension being a
41 display editing facility. Display based editing is the focus of \fBvi\fR.
42 .sp
43 .LP
44 If you have a \fBCRT\fR terminal, you can wish to use a display based editor;
45 in this case see \fBvi\fR(1), which is a command which focuses on the
46 display-editing portion of \fBex\fR.
47 .sp
48 .LP
49 If you have used \fBed\fR you find that, in addition to having all of the
50 \fBed\fR commands available, \fBex\fR has a number of additional features
51 useful on \fBCRT\fR terminals. Intelligent terminals and high speed terminals
52 are very pleasant to use with \fBvi\fR. Generally, the \fBex\fR editor uses far
53 more of the capabilities of terminals than \fBed\fR does, and uses the terminal
54 capability data base (see \fBterminfo\fR(4)) and the type of the terminal you
55 are using from the environment variable \fBTERM\fR to determine how to drive
56 your terminal efficiently. The editor makes use of features such as insert and
57 delete character and line in its \fBvisual\fR command (which can be abbreviated
58 \fBvi\fR) and which is the central mode of editing when using the \fBvi\fR
59 command.
60 .sp
61 .LP
62 The \fBex\fR utility contains a number of features for easily viewing the text
63 of the file. The \fBz\fR command gives easy access to windows of text. Typing
64 \fB^D\fR (CTRL-D) causes the editor to scroll a half-window of text and is more
65 useful for quickly stepping through a file than just typing return. Of course,
66 the screen-oriented \fBvisual\fR mode gives constant access to editing context.
67 .sp
68 .LP
69 The \fBex\fR utility gives you help when you make mistakes. The \fBundo\fR
70 (\fBu\fR) command allows you to reverse any single change which goes astray.
71 \fBex\fR gives you a lot of feedback, normally printing changed lines, and
72 indicates when more than a few lines are affected by a command so that it is
73 easy to detect when a command has affected more lines than it should have.
74 .sp
75 .LP
76 The editor also normally prevents overwriting existing files, unless you edited
77 them, so that you do not accidentally overwrite a file other than the one you
78 are editing. If the system (or editor) crashes, or you accidentally hang up the
79 telephone, you can use the editor \fBrecover\fR command (or \fB-r\fR\fI file\fR
80 option) to retrieve your work. This gets you back to within a few lines of
81 where you left off.
82 .sp
83 .LP
84 The \fBex\fR utility has several features for dealing with more than one file
85 at a time. You can give it a list of files on the command line and use the
86 \fBnext\fR (\fBn\fR) command to deal with each in turn. The \fBnext\fR command
87 can also be given a list of file names, or a pattern as used by the shell to
88 specify a new set of files to be dealt with. In general, file names in the
89 editor can be formed with full shell metasyntax. The metacharacter `%' is also
90 available in forming file names and is replaced by the name of the current
91 file.
92 .sp
93 .LP
94 The editor has a group of buffers whose names are the ASCII lower-case letters
95 (\fBa\fR-\fBz\fR). You can place text in these named buffers where it is
96 available to be inserted elsewhere in the file. The contents of these buffers
97 remain available when you begin editing a new file using the \fBedit\fR
98 (\fBe\fR) command.
99 .sp
101 There is a command \fB&\fR in \fBex\fR which repeats the last \fBsubstitute\fR
102 command. In addition, there is a confirmed substitute command. You give a range
103 of substitutions to be done and the editor interactively asks whether each
104 substitution is desired.
107 It is possible to ignore the case of letters in searches and substitutions.
108 \fBex\fR also allows regular expressions which match words to be constructed.
109 This is convenient, for example, in searching for the word ``edit'' if your
110 document also contains the word ``editor.''
113 \fBex\fR has a set of options which you can set to tailor it to your liking.
114 One option which is very useful is the \fBautoindent\fR option that allows the
115 editor to supply leading white space to align text automatically. You can then
116 use \fB^D\fR as a backtab and space or tab to move forward to align new code
117 easily.
120 Miscellaneous useful features include an intelligent \fBjoin\fR (\fBj\fR)
121 command that supplies white space between joined lines automatically, commands
122 \fB<\fR and \fB>\fR which shift groups of lines, and the ability to filter
123 portions of the buffer through commands such as \fBsort\fR.
124 .SH OPTIONS
127 The following options are supported:
129 .ne 2
131 \fB\fB\(mi\fR | \fB-s\fR\fR
133 .RS 25n
134 Suppresses all interactive user feedback. This is useful when processing editor
135 scripts.
139 .ne 2
141 \fB\fB-l\fR\fR
143 .RS 25n
144 Sets up for editing \fBLISP\fR programs.
148 .ne 2
150 \fB\fB-L\fR\fR
152 .RS 25n
153 Lists the name of all files saved as the result of an editor or system crash.
157 .ne 2
159 \fB\fB-R\fR\fR
161 .RS 25n
162 \fBReadonly\fR mode. The \fBreadonly\fR flag is set, preventing accidental
163 overwriting of the file.
167 .ne 2
169 \fB\fB-r\fR \fIfile\fR\fR
171 .RS 25n
172 Edits \fIfile\fR after an editor or system crash. (Recovers the version of
173 \fIfile\fR that was in the buffer when the crash occurred.)
177 .ne 2
179 \fB\fB-t\fR \fItag\fR\fR
181 .RS 25n
182 Edits the file containing the \fItag\fR and positions the editor at its
183 definition. It is an error to specify more than one \fB-t\fR option.
187 .ne 2
189 \fB\fB-v\fR\fR
191 .RS 25n
192 Starts up in display editing state, using \fBvi\fR. You can achieve the same
193 effect by typing the \fBvi\fR command itself.
197 .ne 2
199 \fB\fB-V\fR\fR
201 .RS 25n
202 Verbose. When \fBex\fR commands are read by means of standard input, the input
203 is echoed to standard error. This can be useful when processing \fBex\fR
204 commands within shell scripts.
208 .ne 2
210 \fB\fB-x\fR\fR
212 .RS 25n
213 Encryption option. Simulates the \fBX\fR command and prompts the user for a
214 key. This key is used to encrypt and decrypt text using the algorithm of the
215 \fBcrypt\fR command. The \fBX\fR command makes an educated guess to determine
216 whether text read in is encrypted or not. The temporary buffer file is
217 encrypted also, using a transformed version of the key typed in for the
218 \fB-x\fR option.
222 .ne 2
224 \fB\fB-w\fR\fIn\fR\fR
226 .RS 25n
227 Sets the default window size to \fIn\fR. This is useful when using the editor
228 over a slow speed line.
232 .ne 2
234 \fB\fB-C\fR\fR
236 .RS 25n
237 Encryption option. Same as the \fB-x\fR option, except that \fB-C\fR simulates
238 the \fBC\fR command. The \fBC\fR command is like the \fBX\fR command, except
239 that all text read in is assumed to have been encrypted.
243 .ne 2
245 \fB\fB+\fR\fIcommand\fR | \fB-c\fR\fI command\fR\fR
247 .RS 25n
248 Begins editing by executing the specified editor \fIcommand\fR (usually a
249 search or positioning command).
253 .ne 2
255 \fB\fB/usr/xpg4/bin/ex\fR, \fB/usr/xpg6/bin/ex\fR\fR
257 .sp .6
258 .RS 4n
259 If both the \fB-t\fR\fI tag\fR and the \fB-c\fR\fI command\fR options are
260 given, the \fB-t\fR\fI tag\fR is processed first. That is, the file containing
261 the tag is selected by \fB-t\fR and then the command is executed.
264 .SH OPERANDS
267 The following operand is supported:
269 .ne 2
271 \fB\fIfile\fR\fR
273 .RS 8n
274 A path name of a file to be edited.
277 .SH USAGE
280 This section defines the \fBex\fR states, commands, initializing options, and
281 scanning pattern formations.
282 .SS "ex States"
284 .ne 2
286 \fBCommand\fR
288 .RS 11n
289 Normal and initial state. Input prompted for by "\fB:\fR". The line kill
290 character cancels a partial command.
294 .ne 2
296 \fBInsert\fR
298 .RS 11n
299 Entered by \fBa\fR, \fBi\fR, or \fBc\fR. Arbitrary text can be entered. Insert
300 state normally is terminated by a line having only "\fB\&.\fR" on it, or,
301 abnormally, with an interrupt.
305 .ne 2
307 \fBVisual\fR
309 .RS 11n
310 Entered by typing \fBvi\fR. Terminated by typing \fBQ\fR or ^\e (Control-\e).
313 .SS "ex Command Names and Abbreviations"
315 .in +2
317 Command    Abbrevi-   Command    Abbrevi-    Command    Abbrevi-
318 Name       ation      Name       ation       Name       ation
320 abbrev     ab         map                    set        se
322 append     a          mark       ma          shell      sh
324 args       ar         move       m           source     so
326 change     c          next       n           substitute s
328 copy       co         number     nu          unabbrev   unab
330 delete     d          preserve   pre         undo       u
332 edit       e          print      p           unmap      unm
334 file       f          put        pu          version    ve
336 global     g          quit       q           visual     vi
338 insert     i          read       r           write
341 join       j          recover    rec         xit        x
343 list       l          rewind     rew         yank       ya
345 .in -2
348 .SS "Join Command Arguments"
350 .in +2
352 Join     [\fIrange\fR] j[\fIoin\fR][!] [\fIcount\fR] [\fIflags\fR]
354 .in -2
359 If count is specified:
361 .ne 2
363 \fB\fB/usr/bin/ex\fR, \fB/usr/xpg6/bin/ex\fR\fR
365 .sp .6
366 .RS 4n
367 If no address is specified, the\fB join\fR command behaves as if \fI2addr\fR
368 were the current line and the current line plus \fIcount\fR (\fB\&.,. +\fR\fI
369 count\fR). If one address is specified, the \fBjoin\fR command behaves as if
370 \fI2addr\fR were the specified address and the specified address plus
371 \fIcount\fR ( \fIaddr\fR\fB,\fR \fIaddr\fR \fB+\fR \fIcount\fR).
375 .ne 2
377 \fB\fB/usr/xpg4/bin/ex\fR\fR
379 .sp .6
380 .RS 4n
381 If no address is specified, the \fBjoin\fR command behaves as if \fI2addr
382 \fRwere the current line and the current line plus \fIcount \fR\fB-1\fR
383 (\fB\&.,. +\fR \fIcount\fR \fB-1\fR). If one address is specified, the
384 \fBjoin\fR command behaves as if \fI2addr\fR were the specified address and the
385 specified address plus \fIcount\fR \fB-1\fR ( \fIaddr\fR\fB,\fR \fIaddr\fR
386 \fB+\fR \fIcount\fR \fB-1\fR).
390 .ne 2
392 \fB\fB/usr/bin/ex\fR, \fB/usr/xpg4/bin/ex\fR, \fB/usr/xpg6/bin/ex\fR\fR
394 .sp .6
395 .RS 4n
396 If two or more addresses are specified, the \fBjoin\fR command behaves as if an
397 additional address, equal to the last address plus \fIcount\fR \fB-1\fR
398 (\fIaddr1\fR\fB, ...,\fR \fIlastaddr\fR\fB,\fR \fIlastaddr\fR + \fIcount\fR
399 \fB-1\fR), was specified.  If this results in a second address greater than the
400 last line of the edit buffer, it is corrected to be equal to the last line of
401 the edit buffer.
406 If no count is specified:
408 .ne 2
410 \fB\fB/usr/bin/ex\fR, \fB/usr/xpg4/bin/ex\fR, \fB/usr/xpg6/bin/ex\fR\fR
412 .sp .6
413 .RS 4n
414 If no address is specified, the \fBjoin\fR command behaves as if \fI2addr\fR
415 were the current line and the next line (\fB\&.,. +1\fR). If one address is
416 specified, the \fBjoin\fR command behaves as if \fI2addr\fR were the specified
417 address and the next line ( \fIaddr\fR\fB,\fR \fIaddr\fR \fB+1\fR).
420 .SS "Additional ex Command Arguments"
422 .ne 2
424 \fB\fB/usr/bin/ex\fR, \fB/usr/xpg6/bin/ex\fR\fR
426 .sp .6
427 .RS 4n
428 For the following \fBex\fR commands, if \fIcount\fR is specified, it is
429 equivalent to specifying an additional address to the command. The additional
430 address is equal to the last address specified to the command (either
431 explicitly or by default) plus \fIcount\fR\fB-1\fR. If this results in an
432 address greater than the last line of the edit buffer, it is corrected to equal
433 the last line of the edit buffer.
437 .ne 2
439 \fB\fB/usr/xpg4/bin/ex\fR\fR
441 .sp .6
442 .RS 4n
443 For the following \fBex\fR commands, if both a count and a range are specified
444 for a command that uses them, the number of lines affected is taken from the
445 count value rather than the range. The starting line for the command is taken
446 to be the first line addressed by the range.
453 l l
454 l l .
455 Abbreviate      ab[brev] word rhs
456 Append  [line]a[ppend][!]
457 Arguments       ar[gs]
458 Change  [range] c[hange][!] [count]
459 Change Directory        T{
460 chd[ir][!] [directory]; cd[!] [directory]
462 Copy    T{
463 [range] co[py] line [flags]; [range] t line [flags]
465 Delete  T{
466 [range] d[elete] [buffer] [count] [flags]
468 Edit    T{
469 e[dit][!] [+line][file]; ex[!] [+line] [file]
471 File    f[ile] [file]
472 Global  T{
473 [range] g[lobal] /pattern/ [commands]; [range] v /pattern/ [commands]
475 Insert  [line] i[nsert][!]
476 List    [range] l[ist] [count] [flags]
477 Map     map[!] [x rhs]
478 Mark    [line] ma[rk] x; [line] k x
479 Move    [range] m[ove] line
480 Next    n[ext][!] [file ...]
481 Open    [line] o[pen] /pattern/ [flags]
482 Preserve        pre[serve]
483 Put     [line] pu[t] [buffer]
484 Quit    q[uit][!]
485 Read    [line] r[ead][!] [file]
486 Recover rec[over] file
487 Rewind  rew[ind][!]
488 Set     T{
489 se[t] [option[=[value]]...] [nooption...] [option?...] [all]
491 Shell   sh[ell]
492 Source  so[urce] file
493 Suspend su[spend][!]; st[op][!]
494 Tag     ta[g][!] tagstring
495 Unabbreviate    una[bbrev] word
496 Undo    u[ndo]
497 Unmap   unm[ap][!] x
498 Visual  [line] v[isual] [type] [count] [flags]
499 Write   T{
500 [range] w[rite][!] [>>] [file]; [range] w[rite][!] [file]; [range] wq[!] [>>] [file]
502 Write and Exit  [range] x[it][!] [file]
503 Yank    [range] ya[nk] [buffer] [count]
504 Adjust Window   [line] z [type] [count] [flags]
505 Escape  ! command [range]! command
506 Scroll  EOF
507 Write Line Number       [line] = [flags]
508 Execute @ buffer; * buffer
512 .ne 2
514 \fB\fB/usr/bin/ex\fR, \fB/usr/xpg4/bin/ex\fR, \fB/usr/xpg6/bin/ex\fR\fR
516 .sp .6
517 .RS 4n
518 For the following \fBex\fR commands, if \fIcount\fR is specified, it is
519 equivalent to specifying an additional address to the command. The additional
520 address is equal to the last address specified to the command (either
521 explicitly or by default) plus \fIcount\fR\fB-1\fR. If this results in an
522 address greater than the last line of the edit buffer, it is corrected to equal
523 the last line of the edit buffer.
530 l l
531 l l .
532 Number  T{
533 [range] nu[mber] [count] [flags]; [range] |                        # [count] [flags]
535 Print   [range] p[rint] [count] [flags]
536 Substitute      T{
537 [range] s[ubstitute] [/pattern/repl/[options] [count] [flags]]
539 Shift Left      [range] < [count] [flags]
540 Shift Right     [range] > [count] [flags]
541 Resubstitute    T{
542 [range] & [options] [count] [flags]; [range] s[ubstitute] [options] [count] [flags]; [range] ~ [options] [count [flags]
546 .SS "ex Commands"
551 l l
552 l l .
553 \fBC\fR forced encryption
554 \fBX\fR heuristic encryption
555 \fB&\fR resubst
556 \fBCR\fR        print next
557 \fB>\fR rshift
558 \fB<\fR lshift
559 \fB^D\fR        scroll
560 \fBz\fR window
561 \fB!\fR shell escape
564 .SS "ex Command Addresses"
569 l l
570 l l .
571 \fIn\fR line \fIn\fR
572 \fB\&.\fR       current
573 \fB$\fR last
574 \fB+\fR next
575 \fB-\fR previous
576 \fB+\fR\fIn\fR  \fIn\fR forward
577 \fB%\fR 1,$
578 \fB/\fR\fIpat\fR        next with \fIpat\fR
579 \fB?\fR\fIpat\fR        previous with \fIpat\fR
580 \fIx\fR\fB-\fR\fIn\fR   \fIn\fR before \fIx\fR
581 \fIx\fR\fB,\fR\fIy\fR   \fIx\fR through \fIy\fR
582 \fB\&'\fR\fIx\fR        marked with \fIx\fR
583 \fB"\fR previous context
586 .SS "Initializing Options"
591 l l
592 l l .
593 \fBEXINIT\fR    place \fBset\fR's here in environment variable
594 \fB$HOME/.exrc\fR       editor initialization file
595 \fB\&./.exrc\fR editor initialization file
596 \fBset\fR \fIx\fR       enable option \fIx\fR
597 \fBset\fR \fBno\fR\fIx\fR       disable option \fIx\fR
598 \fBset\fR \fIx\fR=\fIval\fR     give value \fIval\fR to option \fIx\fR
599 \fBset\fR       show changed options
600 \fBset\fR \fBall\fR     show all options
601 \fBset\fR \fIx\fR\fB?\fR        show value of option \fIx\fR
604 .SS "Useful Options and Abbreviations"
609 l l l
610 l l l .
611 autoindent      \fBai\fR        supply indent
612 autowrite       \fBaw\fR        write before changing files
613 directory               T{
614 pathname of directory for temporary work files
616 exrc    \fBex\fR        T{
617 allow \fBvi\fR/\fBex\fR to read the \fB\&.exrc\fR in the current directory. This option is set in the \fBEXINIT\fR shell variable or in the \fB\&.exrc\fR file in the \fB$\fR\fBHOME\fRdirectory.
619 ignorecase      \fBic\fR        ignore case of letters in scanning
620 list            print \fB^I\fR for tab, $ at end
621 magic           treat \fB\&. [ *\fR special in patterns
622 modelines               T{
623 first five lines and last five lines executed as \fBvi\fR/\fBex\fR commands if they are of the form \fBex:\fR\fBcommand\fR\fB:\fR or \fBvi:\fR\fBcommand\fR\fB:\fR
625 number  \fBnu\fR        number lines
626 paragraphs      \fBpara\fR      macro names that start paragraphs
627 redraw          simulate smart terminal
628 report          T{
629 informs you if the number of lines modified by the last command is greater than the value of the \fBreport\fR variable
631 scroll          command mode lines
632 sections        \fBsect\fR      macro names that start sections
633 shiftwidth      \fBsw\fR        for \fB< >\fR, and input \fB^D\fR
634 showmatch       \fBsm\fR        to \fB)\fR and \fB}\fR as typed
635 showmode        \fBsmd\fR       show insert mode in \fB vi\fR
636 slowopen        \fBslow\fR      stop updates during insert
637 term            T{
638 specifies to \fBvi\fR the type of terminal being used (the default is the value of the environment variable \fBTERM\fR)
640 window          visual mode lines
641 wrapmargin      \fBwm\fR        automatic line splitting
642 wrapscan        \fBws\fR        T{
643 search around end (or beginning) of buffer
647 .SS "Scanning Pattern Formation"
652 l l
653 l l .
654 \fB^\fR beginning of line
655 \fB$\fR end of line
656 \fB\&.\fR       any character
657 \fB\e<\fR       beginning of word
658 \fB\e>\fR       end of word
659 \fB[\fR\fIstr\fR\fB]\fR any character in \fIstr\fR
660 \fB[^\fR\fIstr\fR\fB]\fR        any character not in \fIstr\fR
661 \fB[\fR\fIxy\fR\fB]\fR  any character between \fIx\fR and \fIy\fR
662 \fB*\fR any number of preceding characters
665 .SH ENVIRONMENT VARIABLES
668 See \fBenviron\fR(5) for descriptions of the following environment variables
669 that affect the execution of \fBex\fR: \fBHOME\fR, \fBLANG\fR, \fBLC_ALL\fR,
670 \fBLC_COLLATE\fR, \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, \fBNLSPATH\fR, \fBPATH\fR,
671 \fBSHELL\fR, and \fBTERM\fR.
673 .ne 2
675 \fB\fBCOLUMNS\fR\fR
677 .RS 11n
678 Override the system-selected horizontal screen size.
682 .ne 2
684 \fB\fBEXINIT\fR\fR
686 .RS 11n
687 Determine a list of \fBex\fR commands that are executed on editor start-up,
688 before reading the first file. The list can contain multiple commands by
689 separating them using a vertical-line (\fB|\fR) character.
693 .ne 2
695 \fB\fBLINES\fR\fR
697 .RS 11n
698 Override the system-selected vertical screen size, used as the number of lines
699 in a screenful and the vertical screen size in visual mode.
702 .SH EXIT STATUS
705 The following exit values are returned:
707 .ne 2
709 \fB\fB0\fR\fR
711 .RS 6n
712 Successful completion.
716 .ne 2
718 \fB\fB>0\fR\fR
720 .RS 6n
721 An error occurred.
724 .SH FILES
726 .ne 2
728 \fB\fB/var/tmp/Ex\fInnnnn\fR\fR\fR
730 .RS 29n
731 editor temporary
735 .ne 2
737 \fB\fB/var/tmp/Rx\fInnnnn\fR\fR\fR
739 .RS 29n
740 named buffer temporary
744 .ne 2
746 \fB\fB/usr/lib/expreserve\fR\fR
748 .RS 29n
749 preserve command
753 .ne 2
755 \fB\fB/usr/lib/exrecover\fR\fR
757 .RS 29n
758 recover command
762 .ne 2
764 \fB\fB/usr/lib/exstrings\fR\fR
766 .RS 29n
767 error messages
771 .ne 2
773 \fB\fB/usr/share/lib/terminfo/*\fR\fR
775 .RS 29n
776 describes capabilities of terminals
780 .ne 2
782 \fB\fB/var/preserve/login\fR\fR
784 .RS 29n
785 preservation directory (where \fBlogin\fR is the user's login)
789 .ne 2
791 \fB\fB$HOME/.exrc\fR\fR
793 .RS 29n
794 editor startup file
798 .ne 2
800 \fB\fB\&./.exrc\fR\fR
802 .RS 29n
803 editor startup file
806 .SH ATTRIBUTES
809 See \fBattributes\fR(5) for descriptions of the following attributes:
810 .SS "/usr/bin/ex"
815 box;
816 c | c
817 l | l .
818 ATTRIBUTE TYPE  ATTRIBUTE VALUE
819 CSI     Enabled
822 .SS "\fB/usr/xpg4/bin/ex\fR"
827 box;
828 c | c
829 l | l .
830 ATTRIBUTE TYPE  ATTRIBUTE VALUE
832 CSI     Enabled
834 Interface Stability     Standard
837 .SS "\fB/usr/xpg6/bin/ex\fR"
842 box;
843 c | c
844 l | l .
845 ATTRIBUTE TYPE  ATTRIBUTE VALUE
847 CSI     Enabled
849 Interface Stability     Standard
852 .SH SEE ALSO
855 \fBed\fR(1), \fBedit\fR(1), \fBgrep\fR(1), \fBsed\fR(1), \fBsort\fR(1),
856 \fBvi\fR(1), \fBcurses\fR(3CURSES), \fBterm\fR(4), \fBterminfo\fR(4),
857 \fBattributes\fR(5), \fBenviron\fR(5), \fBstandards\fR(5)
860 \fISolaris Advanced User\&'s Guide\fR
861 .SH AUTHOR
864 The \fBvi\fR and \fBex\fR utilities are based on software developed by The
865 University of California, Berkeley California, Computer Science Division,
866 Department of Electrical Engineering and Computer Science.
867 .SH NOTES
870 Several options, although they continue to be supported, have been replaced in
871 the documentation by options that follow the Command Syntax Standard (see
872 \fBIntro\fR(1)). The \fB\(mi\fR option has been replaced by \fB-s\fR, a
873 \fB-r\fR option that is not followed with an option-argument has been replaced
874 by \fB-L\fR, and \fB+\fR\fBcommand\fR has been replaced by \fB-c\fR
875 \fBcommand\fR.
878 The message \fBfile too large to recover with \fR\fB-r\fR\fB option\fR, which
879 is seen when a file is loaded, indicates that the file can be edited and saved
880 successfully, but if the editing session is lost, recovery of the file with the
881 \fB-r\fR option is not possible.
884 The \fBz\fR command prints the number of logical rather than physical lines.
885 More than a screen full of output can result if long lines are present.
888 File input/output errors do not print a name if the command line \fB-s\fR
889 option is used.
892 The editing environment defaults to certain configuration options. When an
893 editing session is initiated, \fBex\fR attempts to read the \fBEXINIT\fR
894 environment variable. If it exists, the editor uses the values defined in
895 \fBEXINIT\fR, otherwise the values set in \fB$HOME/.exrc\fR are used. If
896 \fB$HOME/.exrc\fR does not exist, the default values are used.
899 To use a copy of \fB\&.exrc\fR located in the current directory other than
900 \fB$HOME\fR, set the \fIexrc\fR option in \fBEXINIT\fR or \fB$HOME/.exrc\fR.
901 Options set in \fBEXINIT\fR can be turned off in a local \fB\&.exrc\fR only if
902 \fIexrc\fR is set in \fBEXINIT\fR or \fB$HOME/.exrc\fR. In order to be used,
903 \fI\&.exrc\fR in \fB$HOME\fR or the current directory must fulfill these
904 conditions:
905 .RS +4
907 .ie t \(bu
908 .el o
909 It must exist.
911 .RS +4
913 .ie t \(bu
914 .el o
915 It must be owned by the same userid as the real userid of the process, or the
916 process has appropriate privileges.
918 .RS +4
920 .ie t \(bu
921 .el o
922 It is not writable by anyone other than the owner.
926 There is no easy way to do a single scan ignoring case.
929 The editor does not warn if text is placed in named buffers and not used before
930 exiting the editor.
933 Null characters are discarded in input files and cannot appear in resultant
934 files.