Reputation: 51
I want to run a program which uses the output from another program. I tried calling system("myfile.exe")
but the executable doesn't seem to be executed. I am using cygwin. How should I run myfile.exe
from within my program?
Upvotes: 0
Views: 175
Reputation: 399
In Cygwin using shell or bash scripts you can store the output of the first program into a variable.
For example we say that program1 is the "date" command and "echo" is the second program. In shell you use:
dt=
`date
`;
will put the value returned by the date command into the variable dt. (grave accent executes the code and returns the output)
echo $dt
prints the value of the variable dt
Upvotes: 1