batching series of non-interactive .q scripts targeting original

I start an interactive KDB+/q session via this cmd line $KDB_HOME/l64/q credit_etrading.q -p 5001I can then see this session by browsing to http://localhost:5001/Normally I go into KDB+ Studio and use that GUI to connect tohttp://localhost:5001/ and load/run a bunch of small .q scripts viathat tool.But now I’d like to do it in a sort of scripted batch mode, non-interactively from a shell, so that the same small .q scripts Iexecuted via studio now get executed at http://localhost:5001/ via thecmd lineE.g.for i in ls -1 A.q B.q C.qdo echo “Trying to execute $i at KDB+/q instance http://localhost:5001/…” $KDB_HOME/l64/q ??? $i #what do I put here to make thiswork?done

Hello Ben,

You should look for remote connections. After you have started the server on localhost,
you should play with the hopen/hclose commands from the command-line:

h : hopen `:localhost:5001
h " any of your commands …"
hclose h

Hope this solves your problem!

BR,
N.

Perfect!  Thanks Norbert.<o:p></o:p>

<o:p> </o:p>

From: personal-kdbplus@googlegroups.com [mailto:personal-kdbplus@googlegroups.com] OnBehalf Of Norbert Purger
Sent: Sunday, October 17, 2010 4:57 PM
To: personal-kdbplus@googlegroups.com
Subject: Re: [personal kdb+] batching series of non-interactive .qscripts targeting original KDB+/q instance<o:p></o:p>

<o:p> </o:p>

Hello Ben,

You should look for remote connections. After you have started the server onlocalhost,
you should play with the hopen/hclose commands from the command-line:

h : hopen `:localhost:5001
h " any of your commands …"
hclose h

Hope this solves your problem!

BR,
N.

<o:p></o:p>

On Sun, Oct 17, 2010 at 6:20 PM, ben.cotton@citigroup.com<ben.cotton@citi.com>wrote:<o:p></o:p>

I start an interactive KDB+/q session via this cmd line

      $KDB_HOME/l64/q  credit_etrading.q   -p 5001

I can then see this session by browsing to http://localhost:5001/

Normally I go into KDB+ Studio and use that GUI to connect to
http://localhost:5001/ andload/run a bunch of small .q scripts via
that tool.

But now I’d like to do it in a sort of scripted batch mode, non-
interactively from a shell, so that the same small .q scripts I
executed via studio now get executed at http://localhost:5001/ via the
cmd line

E.g.

for i in ls -1 A.q B.q C.q
do
     echo “Trying to execute $i at KDB+/q instance http://localhost:5001/
…”
$KDB_HOME/l64/q ??? $i #what doI put here to make this
work?
done


Submitted via Google Groups