on-internet
← Community

How do get a program which transforms its input into standard output, to act in-place?

Stack Overflow ·

I have a program which prints a transformed version of its input text to standard output. Examples might be grep or xmllint --format or something more complicated. Now, I want to run my program on a give file, in-place; but my program doesn't support that inherently. Naturally I can't just run it and direct its output into its input file, that would just garble it. What is a convenient, simple and safe way to 'wrap' my program so that it acts in-place?

Comments

Sign in or sign up to comment and upvote.

No comments yet.