redirecting output, observe with tail -f <file>, while running, without screen?
Hello All,
I know how to redirect output from one program to a file, for example, when I do: ping linuxquestions.org > log & I can observe the contents in real-time, while the program is running with: tail -f log But if I create my own little program, like for example: Code:
#include <stdio.h> Why does it work for ping and not for my own simple C program (compile with gcc without any other options)? How I can I do the same with my program without using a program like screen. Thanks the for help, srons |
|
BTW, the '&' is redundant. Re-direction works anyway eg
./myprog >myprog.out 2>myprog.err OR ./myprog >myprog.log 2>&1 The '&' you used at the end simply puts the prog in the background, which is a separate issue. |
It works, thanks! :)
|
All times are GMT -5. The time now is 03:53 PM. |