Is there a way to have Ed create backups of the file currently loaded into the buffer. On occasion I have inadvertently overwritten my file and found it's not recoverable. I.e. making a backup file with a tilde appended to the original file name (e.g., myfile.txt~), which would contain the previous version of the file.
1 Answer
The ed
editor does not provide a backup facility (or any way to configure it, at all). Writing the editing buffer back to disk with the w
command overwrites the original file.
It is up to you to edit a copy of your original data or save the text with a new filename, either by saving using w some-filename
or using f some-filename
followed by w
.
Some modern filesystems provide snapshotting facilities that would let you retrieve the overwritten data, or you could fetch it from a recent backup, if you overwrote it in error.
diff
to find when I introduced a feature (or a bug). I can seetarConfig.V16
, but I believe I had a.V83
on one project, due to a prevaricating client.