Environment variables in par.txt

https://learninghub.kx.com/forums/topic/environment-variables-in-par-txt

Hi all,


Just checking here if there is any way to use environment variables in par.txt?


I have a segmented database that is available to multiple servers, and one of the segments is mounted on a different path in each server


e.g. in server A it's mounted under /path/to/segment_2/...

in server B it's under /path/to/segment/...


I've tried setting the start of the path to a variable and using e.g. ${MOUNT_PREFIX} and getenv[`MOUNT_PREFIX] in par.txt, but there doesn't seem to be a way to get kdb to resolve these when reading the file.


If this isn't possible, will most likely use sym links instead.


Thanks,

Eoghan

As per the documentation, the par.txt file should contain the path to the individual segments. I don't think you can use environment variables. https://code.kx.com/q4m3/14_Introduction_to_Kdb%2B/#144-segmented-tables

"par.txt

containing the paths of the physical locations of the segments, one segment path per line."

Thanks for the reply,


Yeah looks like there's no way around it. Thankfully sym links work as expected in par.txt