[hackers] [sbase] ed: Correct behaviour of shell escape in r and w || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Wed, 31 Dec 2025 13:20:33 +0100 (CET)

commit 79bc44c1849938925fe05d6fdc81093a85f50215
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.net>
AuthorDate: Wed Dec 31 13:19:34 2025 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.net>
CommitDate: Wed Dec 31 13:19:34 2025 +0100

    ed: Correct behaviour of shell escape in r and w
    
    Shell escapes in these commands do not print a ! after its execution
    but it prints the number of bytes read/write.

diff --git a/ed.1 b/ed.1
index ef826e6..bfd6a37 100644
--- a/ed.1
+++ b/ed.1
_AT_@ -100,7 +100,7 @@ Otherwise, the dot is set to the line before the deleted range.
 .It e Ar file
 Delete the contents of the buffer and load in
 .Ar file
-for editing, printing the bytes read to standard output.
+for editing, printing the number of bytes read to standard output.
 If no filename is given,
 .Nm
 uses the currently remembered filename.
_AT_@ -108,14 +108,15 @@ The remembered filename is set to
 .Ar file
 for later use.
 The current address is set to the last line read.
+.It E Ar file
+As above,
+but without warning if the current buffer has unsaved changes.
 .It e Ar !command
 Delete the contents of the buffer and load in the output of
-.Ar command .
+.Ar command ,
+printing the number of bytes read to standard output.
 The remembered filename is not modified.
 The current address is set to the last line read.
-.It E Ar file
-As the command e,
-but without warning if the current buffer has unsaved changes.
 .It f Ar file
 Set the currently remembered filename to
 .Ar file
_AT_@ -177,7 +178,7 @@ As above, but without warning if the current buffer has unsaved changes.
 Read in
 .Ar file
 and append it to the current buffer at the addressed line,
-printing the bytes read to standard output.
+printing the number of bytes read to standard output.
 The currently remembered filename isn't changed unless it's empty.
 An address of 0 reads the
 .Ar file
_AT_@ -185,10 +186,8 @@ into the start of the buffer.
 .It ($)r Ar !command
 Execute the
 .Ar command
-and append its output in the current buffer at the addressed line.
-When
-.Ar command
-returns a '!' is printed.
+and append its output in the current buffer at the addressed line,
+printing the number of bytes read to standard output.
 The currently remembered filename isn't changed.
 An address of 0 reads the output of
 .Ar command
_AT_@ -229,10 +228,8 @@ the addressed lines are appended to
 instead.
 .It (1,$)w Ar !command
 Write the addressed lines to the standard input of
-.Ar command .
-When
-.Ar command
-returns a '!' is printed.
+.Ar command ,
+printing the number of bytes written to standard output.
 The dot is unchanged.
 .It (.+1)
 An address without a command prints the addressed line.
Received on Wed Dec 31 2025 - 13:20:33 CET

This archive was generated by hypermail 2.3.0 : Wed Dec 31 2025 - 13:24:34 CET