Hi Andrew, Andrew Moore wrote:
GNU ed can now be used again as a systemd editor. Hurrah! Thank you!
You are welcome. :-)
One suggestion: it might be helpful, in addition to setting dot, to print dot. In the particular case of `systemctl edit`, the user doesn't manually invoke `ed +4 ...', so it's easy to assume that dot is at the end of file. Even printing a blank line in this case can be a helpful reminder.
Do you mean executing at startup a '.n', '.l', or '.p' command when setting the current line in the command line, or something else? I think I would need a more precise description of the desired behavior before implementing anything.
Regarding filenames, Unix allows nearly any character in a filename. I'm curious what prompted you to handle control characters specially?
This defect report: https://www.austingroupbugs.net/view.php?id=251 (Forbid newline, or even bytes 1 through 31 (inclusive), in filenames)
A minor issue with the f command is that the following works: ed -p '*' --unsafe-names $'filename\nwith\nnewlines' *f filename\012with\012newlines * But trying to set such a filename with the f command doesn't seem to:
How could it work without backslash-escape processing?
Finally, I agree that gratuitously creating directories is a footgun.
As several experienced ed users have complained about this, I have removed the feature. The change will appear in the next version of ed.
Best regards, Antonio.