title: How to take the output of Sys.command as string in OCaml?
body: <p>In OCaml, I have this piece of code:</p>
  
  <pre><code>let s =Sys.command ("minisat test.txt | grep 'SATIS' ");;
  </code></pre>
  
  <p>I want to take the output of minisat test.txt | grep "SATIS" , which is SATISFIABLE/UNSATISFIABLE to the string s.</p>
  
  <p>I am getting the following output:</p>
  
  <pre><code>SATISFIABLE   
  val s : int = 0
  </code></pre>
  
  <p>So, how can I make the output of this command to a string.</p>
  
  <p>Also, is it possible to even import time?</p>
  
  <p>This is the output I get when I try <code>minisat test.txt</code> in terminal</p>
  
  <pre><code>WARNING: for repeatability, setting FPU to use double precision
  ============================[ Problem Statistics ]=============================
  |                                                                             |
  |  Number of variables:             5                                         |
  |  Number of clauses:               3                                         |
  |  Parse time:                   0.00 s                                       |
  |  Eliminated clauses:           0.00 Mb                                      |
  |  Simplification time:          0.00 s                                       |
  |                                                                             |
  ============================[ Search Statistics ]==============================
  | Conflicts |          ORIGINAL         |          LEARNT          | Progress |
  |           |    Vars  Clauses Literals |    Limit  Clauses Lit/Cl |          |
  ===============================================================================
  ===============================================================================
  restarts              : 1
  conflicts             : 0              (-nan /sec)
  decisions             : 1              (0.00 % random) (inf /sec)
  propagations          : 0              (-nan /sec)
  conflict literals     : 0              (-nan % deleted)
  Memory used           : 8.00 MB
  CPU time              : 0 s
  
  SATISFIABLE
  </code></pre>