I've got a bash script that sets up some environment parameters and then runs a c++ application.
The c++ application outputs information showing it's current state as it runs.
Currently, I only see the results of this once it's finished running. (approx 1 min) Is there anyway to have the bash script show the live output from the application ?
This is what I have so far:
OUTPUT="$(sudo ./test_app -release)"
echo $OUTPUT
I get the following once the application has completed.:
release acknowledgereleasingstage1stage2released
If I ran the application direct from the command line, I'd get this as new line as each process completed, not all in one when the application completed.
release acknowledge
releasing
stage1
stage2
released
Any ideas how to do this ? I'd like to call the app from the bash script to save the users having to run multiple commands.
Thanks.
OUTPUT="$(sudo ./test_app -release)"
withsudo ./test_app -release
in your script? – EightBitTony Feb 26 '16 at 15:22SCRATCH=$(mktemp); ./test_app -release > $SCRATCH 2>&1; [other stuff]; cat $SCRATCH; rm $SCRATCH
– DopeGhoti Feb 26 '16 at 16:48