title: Linux Script with if/else
body: <p>I am executing a daily script in ubuntu server via Cron  which runs a java file. I want to it to be included in if/else block such that if the java file is executed successfully its should send an echo message "successfull" and if it fails it should send an echo message "failed".</p>
  
  <p>Here are the existing lines for the script updateGroupScores.sh</p>
  
  <pre><code>java -classpath "/home/ubuntu/live/build/WEB-INF/lib/*:/var/lib/tomcat7/lib/*:/home/ubuntu/live/build/WEB-INF/classes/" com.generalsentiment.update.UpdateGroupScores &gt; /var/gs/livecron/crongroupsentimentscores.log
  </code></pre>
  
  <p>i want to modify them something like -</p>
  
  <pre><code>if (java file runs successfull)
  then
  echo "cron job successfull"
  
  else
  then 
  echo "cron job failed"
  </code></pre>
  
  <p>--
  Thanks</p>