Files
luash/SPEC.md
2025-08-29 00:18:21 +01:00

38 lines
786 B
Markdown

# Luash
A lua preprocessor for shell scripting.
## Why
Although traditional POSIX shells are highly portable and can be extremely fast, their syntax can be arduous to read.
Lua is a lightweight and fast language that already has the features needed to become a great scripting language.
This project aims to add syntactic sugar to make the process of write commands in lua much easier.
Inspired by other projects such as Xonsh and Ruby.
## Features
Shell execution via backticks
```lua
files = `ls -a`
```
Variable substitution in shell commands
```lua
dir = "/"
files = `ls #{dir}`
```
Environment variable access
```lua
print($SHELL)
terminal = $TERM
print("This will just print normally $SHELL")
print("This will substitute with the environment variable ${SHELL}")
```