On Thu, Jun 16, 2022, at 5:12 PM, Robert E. Griffith wrote:
> I think that the best you can do is either use a temporary file or, if
> you know the file is small enough, read it entirely into memory and then
> write the new data and then the old back out to the same file.
Since the OP is fixated on using the shell's built-in functionality,
it's worth remembering that variables cannot store arbitrary data.
--
vq