Module Xunix.CommandDeprecated Source Command invocation
Typical usage is:
starter |> scanner , for example shell "ls /" |> print
or
starter |> scanner |> result_checker , for example shell "ls /" |> get_stdout |> must_exist_with ~name:"ls /" 0
Starter
Starters invoke processes and returns a value of 'st t. You do not need to care about 'st: it is determined by a output scanner.
Execute a shell command using /bin/sh
Source val execvp : string list -> 'st t Same as shell_command but it takes the command and arguments as a list of string, then directly executed by Unix.execvp.
Output scanner
Output scanner takes the result of a starter and scans its stdout+stderr output. After all the stdout+stderr outputs are sent to the scanner, it returns the final result of the scan and the process status
Source val fold :
'st t ->
init :'st ->
f :('st -> ([ `Out | `Err ] * [ `Read of string | `EOF ] ) -> 'st ) ->
'st result Source val iter :
unit t ->
f :(([ `Out | `Err ] * [ `Read of string | `EOF ] ) -> unit) ->
unit result Iteration over stdout+stderr outputs
Output to stdout and stderr of the command are printed to stdout and stderr resp.ly.
Completely ignore the outputs
Gather stdout lines. Stderr outputs are printed to stderr.
Gather stdout and stderr lines.
Result tools
Source val from_exit : ?name :string -> 'res result -> int * 'res Source val must_exit_with : ?name :string -> int -> 'res result -> 'res