|
From: | Antonio Diaz Diaz |
Subject: | Re: [bug] Don't show "Newline appended" in script/-s mode |
Date: | Fri, 27 Dec 2024 17:57:39 +0100 |
User-agent: | Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 |
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.
[Prev in Thread] | Current Thread | [Next in Thread] |