| Martin Thomsen wrote: | printf '%s\n' 'r !date +"% modified on \%F"' ',p' Q | ed -s | | outputs | | date +"fil1 modified on \%F" | fil1 modified on \2021-07-10 | | I think the output should contain no backslashes, per POSIX | documentation. The GNU ed manual would benefit from clarification.
I agree. This is the correct behavior. In Antonio's defense, this was broken in ed-0.2, which he inherited. Handling of backslash escapes, in general, and in shell commands in particular, is tricky. I feel that I got it right in my implementation. Please check out: https://github.com/slewsys/ed -AM