Unix Script To Move Files Based On Grep

I am looking for advice on how to write a script that will rename and/or move files to a different directory based upon the results of a grep.

Let's say I have ten files in a directory. Some of them - not all - contain the text 'HELLO'. I would like to be able to grep the files for that text, then either rename the files (say, with an extension of ".hello", and/or move them to another directory.

I have made several attempts based on examples I've found on the 'net, but to no avail. Not even sure if this is possible.

Thanks for any info!

for file in $list
do
  grep hello $file >/dev/null
  if [ $? = 0 ]
  then
   mv file
  fi
done

Here is a solution that does not require you to build a list of file names first. If you have a set of file types like; *.txt, *.sh etc.

for x in $(find . -name "*.txt" -exec grep -l HELLO {} \;)
do
    mv $x ${x}.hello
done

one liner

find . -type f -exec grep -il 'HELLO' {} \; -exec mv {} {}.hello \;