Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Runner.ShellSourceShell command representation.
This module is used for the subset of the shell language that is needed to operate remote runners through SSH. It makes sure that shell command are properly quoted.
Commands.
Commands execute a program (whose executable name is name), with some arguments, possibly with some specific environment variables local_env to add to the current environment.
type t = | Cmd of commandrun a command
*)| Seq of t * trun something, then something else (;)
| Echo_pidecho the current process PID (echo $$)
| Redirect_stdout of t * stringredirect stdout to a file (>)
| Redirect_stderr of t * stringredirect stderr to a file (2>)
| Or_echo_false of trun something, if it fails, print "false" (|| echo false)
Shell programs.
Convert a shell program into a string.
The result is quoted using shell syntax.
context specifies whether parentheses are needed:
`top means no parentheses are needed (default);`operator means parentheses may be needed because this command is inside of an operator such as ; or ||.Make a command to execute a program.
Usage: cmd local_env name arguments
Same as: Cmd { local_env; name; arguments }
Make a sequence.
Usage: seq command_1 command_2
Same as: Seq (command_1, command_2)
Make an stdout redirection.
Usage: redirect_stdout command path
Same as: Redirect_stdout (command, path)
Make an stderr redirection.
Usage: redirect_stderr command path
Same as: Redirect_stderr (command, path)