in reply to Re: Re: The easiest way to substitute a part of the content of a file.
in thread The easiest way to substitute a part of the content of a file.

That is roughtly what tilly's "perl -pi" solution does. And I would discourage rewriting the existing file without renaming, that way lies nasty race conditions. Best to write a new file and rename it into place after you are done (you still have a race condition if you have simultaneious writers, but are in good shape in the more common case of a single writer and any number of readers).

        - tye (but my friends call me "Tye")
  • Comment on (tye)Re: The easiest way to substitute a part of the content of a file.