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