This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Spawn a command in the background, optionally redirecting stderr and stdout | |
-- | |
-- requiring this file returns a function(cmd_line, stdout_redirect, stderr_redirect) | |
-- | |
-- `cmd_line` is the command with possible arguments | |
-- optional `stdout_redirect` is io.stdout, io.stderr, or a filename. default/nil is io.stdout | |
-- optional `stderr_redirect` is io.stdout, io.stderr, or a filename. default/nil is io.stderr | |
-- | |
-- Example: | |
-- luajit -e 'require("spawn")("cat /etc/network/interfaces", "foo1", io.stdout)' |