silverbullet/website/API/shell.md

12 lines
305 B
Markdown
Raw Normal View History

2025-01-17 03:41:52 +08:00
The Shell API provides functions for running shell commands.
### shell.run(cmd, args)
Runs a shell command with the specified arguments.
Example:
```lua
local result = shell.run("ls", {"-la"})
print("Output: " .. result.stdout)
print("Errors: " .. result.stderr)
print("Exit code: " .. result.code)
```