POSIX revision 1.2 1 This version of ed is not strictly POSIX compliant, as described in the
2 POSIX 1003.2 Draft 11.2 document. BSD commands have been implemented
3 wherever they do not conflict with the POSIX standard. For backwards
4 compatibility, the POSIX rule that says a range of addresses cannot be
5 used where only a single address is expected has been relaxed.
6
7 The BSD commands included are:
8 1) `s' (i.e., s[rgp]*) to repeat a previous substitution,
9 2) `W' for appending text to an existing file,
10 3) `wq' for exiting after a write, and
11 4) `z' for scrolling through the buffer.
12 BSD line addressing syntax (i.e., `^' and `%'). is also recognized.
13
14 The POSIX interactive global commands `G' and `V' are extended to support
15 multiple commands, including `a', `i' and `c'. The command format is the
16 same as for the global commands `g' and `v', i.e., one command per line
17 with each line, except for the last, ending in a backslash (\).
18
19 If crypt is available, files can be read and written using DES encryption.
20 The `x' command prompts the user to enter a key used for encrypting/
21 decrypting subsequent reads and writes. If only a newline is entered as
22 the key, then encryption is disabled. Otherwise, a key is read in the
23 same manner as a password entry. The key remains in effect until
24 encryption is disabled. For more information on the encryption algorithm,
25 see the bdes(1) man page. Encryption/decryption should be fully compatible
26 with SunOS DES.
27
28 An extension to the POSIX file commands `E', `e', `r', `W' and `w' is that
29 <file> arguments are processed for backslash escapes, i.e., any character
30 preceded by a backslash is interpreted literally. If the first unescaped
31 character of a <file> argument is a bang (!), then the rest of the line
32 is interpreted as a shell command, and no escape processing is performed
33 by ed.
34
35 The vi editor's bang command syntax is supported, i.e.,
36 (addr1,addr2) !<shell-cmd> replaces the addressed lines with the output of
37 the command <shell-cmd>.
38 [rwe] !! reads/writes/edits the previous !<shell-cmd>.
39
40 If ed is invoked with a name argument prefixed by a bang, then the
41 remainder of the argument is interpreted as a shell command. To invoke
42 ed on a file whose name starts with bang, prefix the name with a backslash.
43