I am trying to do something like:
let execute command =
System.Diagnostics.Process.Start (command)
sprintf "%s (command output!)" command
let shell fmt = Printf.ksprintf execute fmt
printfn "%s" (shell "ls -a %s" "/Users/david")
Where the intended output would be:
ls -a /Users/david (command output!)
But I can't see any way for the result type of execute
to "escape" ksprintf
. Is there any way for me to capture the output of execute
?