I have a C file that looks like this:
#include <stdio.h>
int main(void)
{
printf("Hello world\n");
while (1);
return 0;
}
And I would like to see "Hello world" printed in a new file. But it doesn't work when I try to redirect the standard output like this:
./hello_world >> logfile &
And then kill the program hello_world.