#!/bin/bash

compute_volume(){

 volume=`du $1 -sh  | awk '{print $1}'`
 if echo $volume | grep -q 'G'
 then
      original_value=`echo $volume | awk -F 'G' '{print $1}'`
      m_value=`echo $original_value \* 1000 | bc`
      m_value=`awk "BEGIN{print int($m_value)}"`
 elif echo $volume | grep -q 'M'
 then
      m_value=`echo $volume | awk -F 'M' '{print $1}'`
 fi
 echo $m_value
}

#result=`compute_volume /home/lhh/testspace/running/b6e402d31bcd42f8bbb94929c1d83fea/out1/platform.img`
#echo $result