LuaRocks.org had a security incident in September 2026. Read the incident report.

Tiny library for shell scripting with Lua

$ luarocks install sh

Tiny library with syntax sugar for shell scripting in Lua (inspired by Python's sh module): every program on PATH is a function, its output is a value, and chains read like shell pipelines. It keeps stdout and stderr apart, reports exit status and signals, and implements cd, pushd and popd. Runs on Lua 5.1 to 5.5 and LuaJIT and needs no C module.

Optional dependencies: programs are started through luaposix or luv when one of them is installed, and through Lua's own io.popen otherwise. Either one gives a faster backend that streams pipelines through pipes, and luv is the one that works on Windows. Install one of them next to sh:

luarocks install luaposix

or

luarocks install luv

Documentation: https://jblaschke.github.io/luash/ has runnable examples and a page on each part of how the library works. Source and issues: https://github.com/JBlaschke/luash

Versions

scm-2dev3 years ago13 downloads
scm-1dev4 years ago0 downloads
2.0-11 day ago3 downloads
1.3-01 year ago124 downloads
1.2-03 years ago762 downloads
1.1-03 years ago45 downloads
1.0-04 years ago50 downloads

Dependencies

lua >= 5.1

Labels

Manifests