title: [: -le: unary operator expected
body: <p>I am writing a simple code that outputs the number of subdirectories in a directory that start with <code>00</code>. Here is my code:</p>
  
  <pre><code>#!/bin/bash
  
  maxout=2
  
  function getnumber {
      number=`ls | grep 00 | wc -l`
      return $number
  }
  
  qs=`getnumber`
  echo $qs
  if [ $qs -le $maxout ]
      then
          echo 'Youpiiii !!!'
  else
      echo 'Sleeping for 60 sec'
  fi
  </code></pre>
  
  <p>However I get the following error
  <code>[: -le: unary operator expected</code></p>
  
  <p>When I <code>trace</code> my code, the function is working. I have </p>
  
  <pre><code>++ return 5
  </code></pre>
  
  <p>but </p>
  
  <pre><code>+ qs=
  </code></pre>
  
  <p>What am I doing wrong?</p>