How do I append onto pipes?

So my question is if I can somehow send data to my program and then send the same data AND its result to another program without having to create a temporary file (in my case ouputdata.txt). Preferably using linux pipes/bash.

I currently do the following:

cat inputdata.txt | ./MyProg > outputdata.txt

cat inputdata.txt outputdata.txt | ./MyProg2

Answers


Choice 1 - fix MyProg to write the merged output from the input and it's own output. Then you can do this.

./MyProg <inputdata.txt | ./MyProg2

Choice 2 - If you can't fix MyProg to write both input and output, you need to merge.

./MyProg <inputdata.txt | cat inputdata.txt - | ./MyProg2

Here is another way, which can be extended to put the output of two programs together:

( Prog1; Prog2; Prog3; ...  ) | ProgN

That at least works in Bash.


Need Your Help

jQuery Confirm Dialog in ASP.NET Button OnClientClick

asp.net jquery jquery-ui dialog confirm

I have a TemplateField in a GridView in an UpdatePanel with a button called btnDelete. Rather than the standard OnClientClick="return confirm('Are you sure?')" I'd like to use jQuery Dialog.

How do I reference a local resource in generated HTML in WinForms WebBrowser control?

.net winforms webbrowser-control

I'm using a winforms webbrowser control to display some content in a windows forms app. I'm using the DocumentText property to write the generated HTML. That part is working spectacularly. Now I...