-
Notifications
You must be signed in to change notification settings - Fork 227
The shell
Lua RTOS has an integrated shell that allows you to execute certain commands in a linux similar way. The shell is disabled by default, but you can enable it typing os.shell(true) in the prompt or putting os.shell(true) in the system.lua file.
The following explains all the commands supported by the shell.
Print FILE on the standard output.
/ > cat system.lua
-- system.lua
--
-- This script is executed after a system boot or a system reset and is intended
-- for setup the system.
---------------------------------------------------
-- Main setups
---------------------------------------------------
os.loglevel(os.LOG_INFO) -- Log level to info
os.logcons(true) -- Enable/disable sys log messages to console
os.shell(true) -- Enable/disable shell
os.history(false) -- Enable/disable history
/ >
Change the working directory.
/ > cd examples
/examples >
Clear the terminal screen.
Copy the SOURCE file to the DESTINATION file.
/ > cp autorun.lua autorun.old
/ >
Print the syslog contents on the standard output.
Note: dmesg is only available if the underlying storage for your root filesystem is not the SPI FLASH.
Translates programs written in the Lua programming language into binary files that can be later loaded and executed.
DESTINATION is optional, and if it's not provided the compiled filename is the SOURCE filename postfixed with the "c" character.
Example:
-- Compile test.lua into test.luac file
luac test.lua test.luac
-- Compile test.lua into test.luac file
luac test.lua
Move (rename) SOURCE to DESTINATION.
Print name of current/working directory.
/examples > pwd
/examples
/examples >
Remove FILE.