Hi Artyom,

Merry Christmas. :-)

Artyom Bologov wrote:
Just to reuse the thread: what about the echoed shell commands? Neither
-s nor -q seems to suppress the printout of these commands.

POSIX[1] states that those commands must be written unconditionally: "If any replacements of '%' or '!' are performed, the modified line shall be written to the standard output before command is executed".

[1] https://pubs.opengroup.org/onlinepubs/9799919799/utilities/ed.html

$ cat grep.ed | ed -sq CD
Cannot open input file
rm -f CD
echo CD
Newline appended
Useful output starts here ...

We've discussed the "Newline appended" already, but, aside from this, is
that the intended output? I think that -s should suppress some of these
shell echoes. And -q should maybe silence the "Cannot open input file"
error.

"Cannot open input file" belongs in the category of 'help messages', and is printed because your script has a 'H' command. The rest is the intended output, except "Newline appended", which will be fixed in the next release of ed in a few days.


Best regards,
Antonio.

Reply via email to