((section 2 "Outdated egg!" (p "This is an egg for CHICKEN 4, the unsupported old release.  You're almost certainly looking for " (int-link "/eggref/5/shell" "the CHICKEN 5 version of this egg") ", if it exists.") (p "If it does not exist, there may be equivalent functionality provided by another egg; have a look at the " (link "https://wiki.call-cc.org/chicken-projects/egg-index-5.html" "egg index") ". Otherwise, please consider porting this egg to the current version of CHICKEN.") (tags "eggs") (toc)) (section 2 "shell" (section 3 "Introduction" (p "Invoke shell commands")) (section 3 "run" (def (sig (syntax "(run COMMAND ...)" (id run))) (p "Invokes each " (tt "COMMAND") " as a shell command. " (tt "COMMAND") " may be of any data type and is flattened and converted to a string.  " (tt "COMMAND") " is also implicitly quasiquoted so subexpressions may be computed at run-time by unquoting them. Returns an unspecified value.") (p "Note that expressions and subforms are not automatically escaped, so") (pre " (run (ls a \"b c\"))") (p "will pass 3 arguments to the " (tt "ls") " command."))) (section 3 "run*" (def (sig (syntax "(run* COMMAND ...)" (id run*))) (p "Similar to " (tt "run") " but returns the return status of each command as multiple result values."))) (section 3 "capture" (def (sig (syntax "(capture COMMAND ...)" (id capture))) (p "Similar to " (tt "run") " but captures everything written by the subprocess to stdout and returns the output as a string. In case the command fails, an empty string is returned (there is currently no way to distinguish between a failed command and one that produces no output)."))) (section 3 "shell" (def (sig (syntax "(shell COMMAND ...)" (id shell))) (p "Returns a procedure that, when invoked will run the given shell commands. The procedure accepts the same keyword arguments as " (tt "execute") ". Note that unquoted subexpressions in the command-list are evaluated when the procedure is invoked, not when it is created."))) (section 3 "execute " (def (sig (procedure "(execute COMMANDLIST #!key status verbose)" (id execute))) (p "Converts " (tt "COMMANDLIST") " to a string by flattening the list-structure of each command and interspersing it with whitespace (" (tt "\" \"") ") and invokes it as a shell command. If " (tt "status") " is given and true, then " (tt "execute") " returns the exit status, with one result value for each element in " (tt "COMMANDLIST") ". If " (tt "verbose") " is given and true, it overrides the current setting of " (tt "shell-verbose") ".") (p "This is the underlying primitive used by " (tt "run[*]") " and " (tt "shell") "."))) (section 3 "shell-verbose" (def (sig (parameter "shell-verbose" (id shell-verbose))) (p "When true, shell commands invoked via " (tt "run") ", " (tt "run*") " and " (tt "shell") " are displayed on the port given by " (tt "(current-output-port)") "."))) (section 3 "Authors" (p "Felix Winkelmann")) (section 3 "License" (pre " This code is in the public domain")) (section 3 "Version History" (dl (dt "0.3") (dd "added " (tt "capture")) (dt "0.1") (dd "initial version")))))