title: Execute php script from bash , assign output to a bash variable
body: <p>I have a bash script which need to execute some php scripts and to get back the results e.g</p>
  
  <pre><code>#!/bin/bash
  /usr/bin/php -f $HOME/lib/get_fifobuild.php
  </code></pre>
  
  <p>The  script get_fifobuild.php returns an integer which I need to assign into a bash variable. I ll appreciate if someone help me out. </p>
  
  <p>thanks :)</p>
  
  <p><strong>Edit:</strong>
  php show.php</p>
  
  <pre><code>&lt;?php 
    echo phpinfo();
    exit;
  ?&gt;
  </code></pre>
  
  <p>bash script:</p>
  
  <pre><code>#!/bin/bash
  HOME=`dirname $0`;
  log(){
      NEW_LOG=$HOME/logs/cloud-`date +%d_%m_%Y`.log
      echo $1 &gt;&gt; $NEW_LOG
  }
  log "Date: `date`";
  data=$(/usr/bin/php -f  $HOME/lib/show.php);
  log $data;
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>Date: Fri Jun 15 19:16:00 PKT 2012
  phpinfo()
  </code></pre>
  
  <p>no luck yet </p>