title: Check a c file output in Linux
body: <p>I have 2 files .c which only contain a printf(&quot;x&quot;)
  I am in bash script and i want to check if the values in the printf are for project1.c =20 and for project 2 =10,and then make some changes depending on the values.
  How am i supposed to make the comparison in the if command?
  This is what i have tried to do,not sure if it is right way.</p>
  <pre><code>for d in $1/*/*
  
  do
  gcc project1 project1.c 
  if[ ./project1 = 20 ];then
  $project1 =30
  else
  $project1 =0
  fi
  gcc project2 project2.c
  if[ ./project2 =10 ];then
  $project2 = 70
  else
  $project2 = 0
  fi
  sum=$project1 + $project2
  echo &quot;project1 : $project1 project2: $project2 total grade: $sum&quot; &gt;&gt; grades.txt
  
  done
  fi
  </code></pre>