Searching for a substring in a bash script will not work
<p>I have been writing a bash script to call in my .bashrc file to print the results of whatis for a random command in my /usr/bin folder and wanted to exclude commands that returned "nothing appropriate" in the result and even if I use grep, wc, expr, ==, nothing seems to work. I have pretty much used every example <a href="https://stackoverflow.com/questions/4467735/how-to-find-substring-inside-a-string-or-how-to-grep-a-variable">here</a>, and <a href="https://stackoverflow.com/questions/229551/string-contains-in-bash">here</a> with no progress. This is what I have so far but failes to do what I want when it finds somthing that contains "nothing appropriate." If anyone could figure out how to get it to work or what a good solution would be in this situation I would be greatfull. </p>

<pre><code>#! /bin/bash

echo "Did you know that:";
while :
do
  RESULT=$(whatis $(ls /usr/bin | shuf -n 1))
  if [[ $RESULT != *"nothing appropriate"* ]]
  then
    echo $RESULT
    break
  fi
done
</code></pre>