# 06 — Implement piping between commands **Status:** open (post-core) **Blocked by:** #03, #04 ## Syntax ```lua local result = `ls -l` | `grep ".lua"` ``` ## Implementation - Connect stdout of one child to stdin of the next via `pipe()` + `dup2()` - Build a pipeline of N processes, all forked and connected - Only capture stdout/stderr of the **final** process - `waitpid()` all children, return exit code of last process ## Challenge Lua uses `|` for bitwise OR. The parser needs to disambiguate: - `|` between two command expressions → pipe - `|` between numeric expressions → bitwise OR This is resolvable because the parser knows the type of each subexpression — a backtick expression is always a command.