0

I am running an A.I. and trying to have the output displayed on the terminal while writing to a .csv file.

The command was something like:

$ ./run | tee rdata.csv

And nothing happened, no output from the terminal and nothing on the.csv file as well. The program itself ran without a problem. What am I missing?

Thanks!

rturrado
  • 7,699
  • 6
  • 42
  • 62
HughLXS
  • 25
  • 1
  • 5
  • 1
    Does it print any output when run without piping to `tee`...? – CiaPan Jan 01 '22 at 15:43
  • Yes, the outputs were displayed on the terminal without any issue. Btw I probably should have added that its running on C++ – HughLXS Jan 01 '22 at 15:46
  • Why do you think that the programming language matters? – Barmar Jan 01 '22 at 15:48
  • 1
    Does the program produce continuous output without ending? There may be buffering delaying the output. – Barmar Jan 01 '22 at 15:49
  • 1
    Maybe this will help: https://stackoverflow.com/questions/11337041/force-line-buffering-of-stdout-in-a-pipeline – Barmar Jan 01 '22 at 15:50
  • Is the output printed when you pipe it through `cat` or through `more`? The process may check whether its output stream is associated with a terminal and avoid printing anything if it's not (although it would not be a good practice). – CiaPan Jan 01 '22 at 15:53

1 Answers1

0

try this command it may help you.

./run 2>&1 >> rdata.csv
rezshar
  • 570
  • 1
  • 6
  • 20