Quote:
Originally Posted by
MadeInGermany
Hmm I think asynchronous background jobs MUST go to separate logs.
Otherwise they might overwrite each other, and the shared log file becomes a mess.
Note that in the code I suggested in post #8, the output to the single log file is produced by a single invocation of the
printf utility that uses an append redirection operator (
>>) instead of the overwrite redirection operator (
>) that was in the original code. Although not required by the standards, I would expect the output of that invocation of
printf to be produced by a single
write() system call, which, when writing the amount of data shown in the examples to a regular file, should be an atomic operation. Using the append redirection should prevent the concurrent background processes from overwriting each other's output and the single
printf instead of multiple
echos should keep the output from the various background processes from being intermixed.