I am currently learning how to use bash script and q together, to route stdout and stderr
Here is my logging q file, called logger.q
///////////////
.log.out: {-1 x};
.log.err: {-2 x};
.z.ts:{.log.out[(string[.z.P]," Outn")];.log.err[(string[.z.P]," Errorn")]}
t 5000
///////////////
When I start the q process and by running the command:
nohup q logger.q > new.log 2>&1 &
It only seems to have logged once, rather than every 5 seconds?
When kdb+ has completed executing a script passed as a command-line argument, and if there are no open sockets nor a console, kdb+ will exit. The timer alone is not enough to stop the process exiting it must have an event source which is a file descriptor (socket, console, or some plugin registering a file descriptor and callback via the C API sd1 function).