shell
Canonical Import
fennel
(local shell (require :shell))Source Files
src/lua_shell.cppsrc/lua_shell_windows.cppsrc/lua_runtime.cpp
What It Provides
shell runs bounded Bash command strings and returns captured output and timing information.
API Summary
bash(command timeout)runsbash -lc commandwith a positive timeout in seconds.bash({:command ... :timeout ... [:cwd ...]})also supports a working directory.- The result table includes
command,timeout,cwd,exit_code,signal,timed_out,stdout,stderr, andduration_ms.
Examples
fennel
(local shell (require :shell))
(local out (shell.bash {:command "printf docs" :timeout 2}))
(print out.exit_code out.stdout)Errors and Platform Notes
command must be a non-empty string and timeout must be greater than zero. Windows builds expose the module but bash raises shell.bash is not supported on Windows builds.
Related Modules
Aliases and Search Terms
Search terms: bash, command shell, shell command, terminal command.
