Search code examples
kdb

Q/KDB: How do you call system commands in a lambda/function


How do you call system commands in a lambda/function?

E.g. I would like to load a q script through .z.ts

Trying .z.ts:{\l myScript.q} does not work. Thanks in advance!


Solution

  • You can use the loading system function in the format

    system "l [x]"
    

    For example:

    .z.ts:{system "l myscript.q"}
    

    You can find some information about using system commands, like so, here: https://kx.com/blog/kdb-q-insights-scripting-with-q/