Thanks, Paul! You're not the first to recommend using temporary files. I'll have to give that a shot. Thanks for that! Since the files you use are in /tmp, do you have them automatically cleaned up somehow, or do you just let them pile up and manually delete them if/when you need to?
On Wed, Dec 4, 2019, at 9:21 PM, Paul Jackson wrote: > Since I grew up in the earlier days of ed, before there > was a "yank" buffer, I developed habits using temp > files that accomplish the same thing > > Here's a session where I solve this problem in the > way that I've been doing it for over 40 years: > > ======== Begin ======== > $ ed test1 > 25 > ,n > 1 test1 text > 2 a second line > .w /tmp/pj1 > 14 > e test2 > 11 > r /tmp/pj1 > 14 > ,n > 1 test2 text > 2 a second line > ========= End = ======== > > My temp buffers have names matching "/tmp/pj*", > since my login id, this entire time, has been "pj", > and I began Unix on a PDP 11/45 shared with others, > so it was best to name my temp files in a way unlikely > to collide with those of others on the system. > > Even though "ed" continues to be my primary editor, > throughout the years, I did not even know that "yank" > existed until just now. > > There are often 100 or 200 hundred "/tmp/pj*" files > in my /tmp directory, dating back many months, > with names just sufficiently unique that I can > remember what they mean while I am actually > and immediately using them. Likely the particular > name "/tmp/pj1" is my favorite, and gets re-used > several times a day, as it just did now, above. > > Perhaps some readers of this thread might find > the above a useful habit to develop. > > -- > Paul Jackson > p...@usa.net > >