title: Bash scripting missing ']'
body: <p>I am getting an error ./test.sh: line 13: [: missing `]' in the file test.sh
  I tried using brackets and other options such as -a or by checking the size of the file p1 but the error is always there and the else statement is always executed irrespective of the input given.I even tried by removing the ; in line 13 but it didn't help.</p>
  
  <p>test.sh</p>
  
  <pre><code>#!/bin/bash
  echo "Enter app name"
  read y
  $y &amp;
  top -b -n 1 &gt; topLog.log
  #-w checks for the whole word not and sub string from that word
  grep -w "$y" topLog.log &gt; p1
  #-s option checks if the file p1 is present or not
  if [ -s "p1"];  #line 13
  then 
      echo "Successful "
  else
      echo "Unsuccessful"
  fi
  rm p1
  </code></pre>
  
  <p>I am new to bash scripting.So if there is any silly mistake please excuse me.</p>