I am trying to set a virtual switch variable using the output from a os.execute command (cat of a file containing a numerical value, i.e 0 or 1). I have a veralite running UI5.
The first line define a variable with the linux cat command. The file contains the string “0”.
The second line tries to define the variable “test” to the value retrieved with the cat command.
It did not work… it sets the variable to “lum” instead to “0”
I am new on this and not a programmer at all so apologies if the above looks silly. I thought it would be a good way to explain what I wanted to achieve
I think os.execute() only returns an execution status… I’d suggest that you rather read the file using lua file handling extensions and assign the variable from reading the file… I am pretty sure you can search around for some code examples (am on the road so cannot send one for the time being)