title: No such file or directory with grep command
body: <p>Following is the output of my Unix command</p>
  
  <pre><code>$ /data/nagios/libexec/check_http -I example.com  -C 30 -p443 --sni
  OK - Certificate 'example.com' will expire on 05/10/2020 12:00. 
  </code></pre>
  
  <p>But when I do a grep on the output inside a script,it shows "No such file or directory"</p>
  
  <pre><code>grep: OK - Certificate 'example.com' will expire on 05/10/2020 12:00.: No such file or directory
  </code></pre>
  
  <p>Below is the script</p>
  
  <pre><code> #!/bin/bash
   output=`/data/nagios/libexec/check_http -I example.com  -C 30 -p443 --sni`
   grep 'OK' "$output"
  </code></pre>
  
  <p>Can anybody please guide how to resolve this. It works fine when I execute directly on commandline</p>
  
  <pre><code>  $ /data/nagios/libexec/check_http -I example.com  -C 30 -p443 --sni | grep OK
    OK - Certificate 'example.com' will expire on 05/10/2020 12:00.
  </code></pre>