title: Working with conditions based on command output
body: <p>I have the following code:</p>
  
  <pre><code>#!/bin/bash
  
  for f in `find . ! -type d`;
  do
          line=`grep -i 'todo' $f | sed 's/^[ \t]*//'`
          if [ $line ]; then
                  echo "$f:"
                  echo "$line"
          fi
  done
  </code></pre>
  
  <p>but the condition is not working as I would expect it, I need it to only work if something other than an empty string (or nothing) is returned by the command.</p>