I am trying to pass bash output do dzvents, unfortunately no success. Could please some one help me?
I have made helper function for that. It is based on stuff I found in this forum.
Code: Select all
return {
helpers = {
bash_var = function(input)
local cmd = input
local f = assert(io.popen(cmd, 'r'))
s = assert(f:read('*a'))
f:close()
print(s)
output = tonumber(s1)
print(output)
end,
}
}
It gives me an output like this in log:
Notice the empty line. I am not able to use output as number variable like that.2020-05-15 09:44:00.654 Status: dzVents: 240.0
2020-05-15 09:44:00.654
Does anyone have an idea how to remove empty line from output?
Or any suggestion with different approach?