The core problem with using the syntax
Command >ram:log *>>ram:log
is that you now have two streams writing to the same file. Neither stream knows what the other has written, so parts of the output will be overwritten.
To expand your simple test above.
#include <stdio.h>
int main()
{
fprintf(stdout,"STDOUT1\n");
fflush(stdout);
fprintf(stderr,"STDERR1\n");
fflush(stderr);
fprintf(stdout,"STDOUT2\n");
fflush(stdout);
fprintf(stderr,"STDERR2\n");
fflush(stderr);
fprintf(stdout,"STDOUT3\n");
fflush(stdout);
return 0;
}
9.AmigaOS4:> gcc -o ram:testit test.c
9.AmigaOS4:> ram:testit >RAM:LOG *>>RAM:LOG
9.AmigaOS4:> type ram:LOG
STDERR1
STDERR2
STDOUT3
You need to redirect stderr to stdouts stream. Not 100% sure if you can do that at the shell level.
Historicaly in AmigaDOS pre AmigaOS 4 shells STDERR and STDOUT were the same stream so no extra sysntax would be needed.