How do you execute code or executable .lua files in Luvit repl command prompt?

2.1k Views Asked by At

While in a Linux terminal on a virtual machine, I came across a need to get a bash shell on a particular user, running Luvit repl. I had never previously heard of the program and found very little documentation on it, none of which looked anything like what was shown in the terminal. What was shown appeared to be a standard program console, however any input yielded seemingly no result, with the input just being pasted to the next input line, now unable to be deleted via backspace or any other delete keys. The only results ever displayed were a number of unhandled keys, which only changed when non standard keys such as the escape key were imputed, and anything else typed was just appended to the passed input, and the process continued. Furthermore, the only way to exit the program seemed to be ^C, which also exited me out of my remote connection to the virtual machine. How would someone execute a .lua file within this command prompt?

Code response to math, quit, and escape

1

There are 1 best solutions below

1
Paul Kulchenko On

You can use dofile "path/to/file.lua" to load and execute a file (dofile).