When I do my_script < filename.txt > filename.txt, the file is overwritten and truncated.
Is there some way on the Unix command line to specify that redirection is not done concurrently, i.e. the output does not begin until the input has completed?
I am trying to write a utility that reads a file, and based on the command line options, regenerates and overwrites it. I realize I could add support in the program for not using stdin/stdout, but I like the flexibility and convenience of redirection.