title: Shell script. if statement is not working
body: <p>I have written a small shell scipt, but I cannot get my if statement to work. </p>
  
  <p>I am running a while loop through a file (14380 lines and 134 columns), and I want to do some work on certain lines following the criteria  <code>number in column 4 &gt; 6 and number in column 4 &lt; 7</code>. The number in column 4 is a real number, and I know that the if-statement is only operating with integers. Is this my problem? I thought that the if-statement would read my number <code>get_lon</code> as a interger, ex. <code>get_lon=14.824</code> it would read it as <code>get_lon=14</code>. That would be okay with be.
  After long time, it is not giving an error messages, but it do not filter data as I want. Right now all lines of the file are going through the test.</p>
  
  <pre><code>#!/bin/bash/sh
  ulimit -s unlimited
  datafile=$1
  
  wfno=0
  cat $datafile | while read line 
  
  do        
      wfno=`expr $wfno + 1`  
      echo $wfno      
  
      get_lon=`awk '(NR=='$wfno'){print $4}' $datafile`
      echo $get_lon
  
      if test ["$get_lon" &gt; "6" -a "$get_lon" &lt; "7"] 
      then      
          awk '(NR=='$wfno'){for(i=7;i&lt;=NF;i++){print i-7, $i;}}' $datafile &gt; xy
          echo 'awk done '
  
          some more stuff...
      else
          echo "Line not valid"
      fi
  done
  </code></pre>
  
  <p>Please, can anybody help?</p>