This commit is contained in:
2025-08-29 00:18:21 +01:00
commit b750a9b71e
16 changed files with 1485 additions and 0 deletions

38
SPEC.md Normal file
View File

@@ -0,0 +1,38 @@
# 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}")
```