I have an application that takes a few command line parameters, then prints some text to the terminal, then starts writing data to a file. It has a parameter I can use to define the file name to write to (like
I would like to process that data (live) using another application, so I tried making the program output its data to stdout by specifying
-o - and piping the output to another tool. However, unfortunately, that program isn't smart enough to notice that it is writing to stdout and that it should stop writing human-readable text to stdout (as that messes up the binary data).
So, usually, the tool would write text to stdout (which I don't care about) and data to a file. I would like to ignore all the text written to stdout and instead have it write the data to stdout so I can pipe it into another tool. However when I run it with
-o -, it writes both the (binary) data and the useless text into stdout, ruining the data.
-o >( my_other_tool ) instead of a pipe, but that resulted in
Couldn't open output: /dev/fd/63: /dev/fd/63: No such file or directory.
Is there another way - other than recompiling the tool and removing all the useless printf calls - to ignore the original stdout and send the data it would write to a file to stdout instead?
EDIT: In case it is helpful, I am talking about nsntrace.