So this is probably a stupid question, but I can't see what I'm doing wrong.
I am running a program that produces output when called like ./ar
. The output looks like:
-0.00781 0.02344 0.98828
-0.01172 0.02734 0.98828
-0.01562 0.02344 0.98047
-0.00781 0.02344 1.00000
-0.00391 0.02344 0.98438
A new line of output is written every second.
When I call the code like this ./ar > log
and kill the program using ctrl-c
after a few seconds, the file log
is empty.
I am running this code on an embedded system. The system has a writeable partition which is the partition that I am running in, and I have write access as I am logged in as root.
The reason is the lazy writing concept of UNIX system.
Are you sure you are looking at standard output in you call ./ar? It might be standard error. So, try ./ar >log 2>err to have 2 files, one for stdout and one for stderr.
Or use ./ar 2>&1 >log to get one file for both streams.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With