title: how to execute if else condition with ssh to remote server
body: <p>I am using following script to remote connection to a server and then if connection is successful then echoing success and if success then trying to sudo a file 
  .If connection failed then it should echo FAIL. e.g</p>
  
  <pre><code>#!/bin/sh
  ssh -t -t rxapp@$1
  'if [$? -eq 0 ];
  then
  echo "SUCCESS"
  sudo /etc/init/ntp $2
  else
  echo "FAIL: Couldnot connect to remote server"
  fi'
  </code></pre>
  
  <p>Here $1 and $2 are given on command line .
  But this is not getting successful.Script only doing successful ssh but not running sudo and other echo commands.
  Output :
  Successful SSH but one exiting it showing following </p>
  
  <pre><code>./jenkins_ucf.sh: line 9: if [$? -eq 0 ];
  then
  echo "SUCCESS"
  sudo /etc/init.d/unifiedCommFwk $2
  else
  echo "FAIL: COuldnot connect to remote server"
  fi: No such file or directory
  </code></pre>
  
  <p>ANy help please ? or any alternative to it will be helpful too.</p>