cleaned up docs

This commit is contained in:
alm 1993-04-14 12:22:59 +00:00
parent b9b97259e6
commit d95358e7cc
3 changed files with 42 additions and 41 deletions

View File

@ -1,16 +1,18 @@
This version of ed is not strictly POSIX compliant, as described in the
POSIX 1003.2 Draft 11.2 document (see the file `ed-1003.2'). BSD commands
have been implemented wherever they do not conflict with the POSIX
standard. In addtion, the POSIX rule that says a range of addresses
cannot be used where only a single address is expected has been relaxed
(see the file `legal-addrs').
standard. For backwards compatibility, the POSIX rule that says a range
of addresses cannot be used where only a single address is expected has
been relaxed (see the file `legal-addrs').
The BSD which have been added include the BSD `W' command for appending
text to an existing file, the BSD `s' command (i.e., s[rgp]*) to repeat
a previous substitution, the BSD `z' command for scrolling through the
buffer, and the BSD `wq' command for exiting after write. The BSD line
addressing syntax (i.e., `^' and `%' - see the file `legal.addrs') is also
recognized.
The BSD commands included are:
1) the `W' command for appending text to an existing file,
2) the `s' command (i.e., s[rgp]*) to repeat a previous substitution,
3) the `z' command for scrolling through the buffer, and
4) the `wq' command for exiting after a write.
BSD line addressing syntax (i.e., `^' and `%' - see the file
`legal.addrs') is also recognized.
The POSIX interactive global commands `G' and `V' are extended to support
multiple commands, including `a', `i' and `c'. The command format is the
@ -18,32 +20,32 @@ same as for the global commands `g' and `v', i.e., one command per line
with each line, except for the last, ending in a backslash (\).
If crypt is available, files can be read and written using DES encryption.
The `x' command prompts the user to enter a key for encrypting/decrypting
subsequent reads and writes. If only a newline is entered as the key,
then encryption is disabled. Otherwise, a key is read with echoing turned
off until a newline is entered. For more information on the encryption
algorithm, see the bdes(1) man page. Encryption/decryption should be
fully compatible with SunOS DES.
The `x' command prompts the user to enter a key used for encrypting/
decrypting subsequent reads and writes. If only a newline is entered as
the key, then encryption is disabled. Otherwise, a key is read in the
same manner as a password entry. The key remains in effect until
encryption is disabled. For more information on the encryption algorithm,
see the bdes(1) man page. Encryption/decryption should be fully compatible
with SunOS DES.
An extension to the POSIX file commands `E', `e', `r', `W' and `w' is that
<file> arguments are processed for backslash (\) escapes, i.e., any
character preceded by a backslash is interpreted literally. A trailing
backslash is ignored. If the first unescaped character of a <file>
argument is a bang (!), then the rest of the line is interpreted as a
shell command and no escape processing is performed by ed. This rule does
not apply to the 'f' command (described below).
<file> arguments are processed for backslash escapes, i.e., any character
preceded by a backslash is interpreted literally. A trailing backslash
is ignored. If the first unescaped character of a <file> argument is a
bang (!), then the rest of the line is interpreted as a shell command,
and no escape processing is performed by ed. This rule does not apply to
the 'f' command (described below).
While the default file name cannot be set to a shell command (i.e.,
!<shell-cmd>) via any of the `r', `w', and `e' commands, POSIX evidently
does not preclude using the `f' command for this purpose. Upon reading
or writing the default file when its name begins with a bang (!), ed
or writing the default file when its name begins with a bang, ed
interprets the rest of the line as a shell command and attempts to execute
it. Escape processing is not performed in this case. The `f' command
can be used in this way as a simple macro function. For example, after
setting the default file name to `!echo hello, world', the command `.r'
inserts the line `hello world' after the current line. The `f' command
with no arguments prints the default unescaped file name.
it. Escape processing is not performed in this case.
If ed is invoked with a name argument prefixed by a bang, then the
remainder of the argument is interpreted as a shell command. To invoke
ed on a file whose name starts with bang, prefix the name with a backslash.
--
The following commands are neither part of POSIX 1003.2 D11/2 nor are
they supported in this version of ed.

View File

@ -14,7 +14,7 @@ address 0. This means "before the first line," and is legal wherever it
makes sense.
An address range is two addresses separated either by a comma or
semi-colon. The value of the first address in a range should exceed the
semi-colon. The value of the first address in a range cannot exceed the
value of the the second. If an n-tuple of addresses is given where
n > 2, then the corresponding range is determined by the last two addresses
in the n-tuple. If only one address is expected, then then the last
@ -45,16 +45,15 @@ $ - last line
lower case letter
Examples:
The address tuple `4;+1' is equivalent to the address pair `4,5'.
The address tuple `1;+2,+3' is equivalent to the pair `3,4'.
The address tuple `1;+2;+3' is equivalent to the pair `3,6'.
The address tuple `4;+1' is equivalent to the address range `4,5'.
The address tuple `1;+2,+3' is equivalent to the range `3,4'.
The address tuple `1;+2;+3' is equivalent to the range `3,6'.
The command `1;m+' swaps the first and second lines.
The command `0;/pat/;//r !date' reads the output of the shell command
`date' to after the second line containing the pattern pat.
The command `0;/pat/r file' reads `file' to after the line containing the
pattern pat.
The command `t0;/pat/' copies the current line to after the first line
containing the patter pat.
containing the pattern pat.
The last two examples above violate the POSIX rule that says a range cannot
be used where at most a single address is expected. This rule has been
relaxed to enable such syntax. An alternative approach is to redefine
the semi-colon as a binary operator that yields a single address.
relaxed to enable such syntax.

View File

@ -41,8 +41,8 @@ u - undo the last command (POSIX)
(1,$)w <file> - write lines in the buffer to a file
(1,$)w !<shell-cmd> - write lines to the stdin of <shell-cmd> (POSIX)
x - prompt for an encryption key (SunOS) {1}
(.,.+rows)z<rows> - page <rows> lines at a time to stdout (BSD)
(.,.)<newline> - print lines to stdout (BSD)
(.+1)z<rows> - page <rows> lines at a time to stdout (BSD)
(.)<newline> - print line to stdout (BSD)
--
{1} See the file `extensions' for additional information on these