You don't. It is not needed or desirable to put the command into an Environment Variable (like $cmd in your script).
Your whole script should be just:
#!/bin/bash
cd /
find . -type f -name *.txt | awk '{ printf "FILE: "$1; system("less "$1);}' | egrep 'FILE:|$1'
Note that the first parameter in "find" should be the name of a directory or "." (current directory) and in your case you should confine the search to files (-type f).
There are probable bugs in the command line. The "egrep" in particular.
Not clear what the script is meant to do but searching down from root is not usually a good idea because you will find directories and files which you cannot read.
I started programming with C and was searching for defined functions in header files (*.h) on this system here.
I also now got another help related using parameter '-exec grep -i word' with 'find' to search for content in files.