Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Concating in Lua using ; issue

I can't concate when using a ';'. The following yeilds nothing in the below dump.txt:

returnString = returnString..Data[1]..","..Data[2]..";"

but if I do this, the data is placed inside dump.txt:

returnString = returnString..Data[1]..","..Data[2].."."

This is under Lua 5.2 in an embedded Linux OS. Does anyone know why the first doesn't work? Is this related to something I'm doing wrong from a code perspective or does this point towards an OS issue? I'm using this command to view the variables output:

 os.execute("echo "..returnString.." >>/tmp/dump.txt")
like image 676
Nimjox Avatar asked Jan 27 '26 13:01

Nimjox


1 Answers

os.execute("echo "..returnString.." >>/tmp/dump.txt")

This translates into the command line:

echo x,y; >> /tmp/dump.txt

Can you see why that wouldn't work?

like image 55
Mud Avatar answered Jan 29 '26 05:01

Mud



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!