Passing db path to \ l or .Ql using variable

I am writing a q script that loads db in a specific path and does some processing on it. The db location is currently hardcoded in the script, but I want to pass the db path as an argument and get it to load from the path in a variable.

Currently it looks like this:

q) \l /path/to/dbDir        #Works

I realized that .Ql should allow us to do this with a variable, so I tried using the following in a script,

dbPath:`$.z.x 0
.Q.l hsym dbPath            #Fails

When launched with the / path / to / dbDir argument, the script always fails with some unreadable stuff and:

':/path/to/dbDir: No such file or directory

Can anyone help?

+5
source share
3 answers

. Ql \l , hsym, .

, , ( hsym)

+4

\x ... system"x ...", " \

,

system"l ",.z.x 0

(btw, , .Q.l \l , , .q)

+4

, , , .Q.l hsym:

dbPath:`$.z.x 0
.Q.l dbPath
+3