running OS commands - Kdb+ / qStudio

Home Forums Kdb+ / qStudio running OS commands

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #220

    Bob
    Guest

    How can I call OS commands from kdb+?

    #233

    Hi Bob,

    Anything entered after a slash \ is first checked to see if its a kdb command, if not it is then ran as a console command. Notice below I run two dos commands (cd and echo) but the last \p call is in faact a kdb command to get/set the port.

    `
    q)\cd
    “C:\\Users\\admin”
    q)\echo “test”
    “\”test\” ”
    q)\p
    0
    q)\p 5000
    q)\p
    5000`

    Alternatively you can make the same calls using a system format:
    `q)system “cd”
    “C:\\Users\\admin”
    q)system “echo 12”
    “12 ”
    q)system “p”
    5000`

    All kdb’s internal commands are one letter so overlap isn’t usually an issue.

    – Ryan

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.