This new release of LuSH brings some interesting and important improvements (not officially supported by LUA), being:
String interpolation
local name = "Thiago"
env.print("My name is ${name}")
String split
local items = string.split("string with spaces", " ")
Shell exec
print("Lush scripts:")
$> ls scripts | grep ".lush"
outputs:
Lush scripts:
mod1.lush
test2.lush
test3.lush
Subshell exec
print("Lush scripts, again:")
local scripts = $( ls scripts | grep ".lush" )
local tok = string.split(scripts, '\n', false)
for i, v in ipairs(tok) do
print(i .. ': ' .. v)
end
outputs:
Lush scripts, again:
1: mod1.lush
2: test2.lush
3: test3.lush
Installing:
To install, simply run:
cargo install lush
Top comments (0)