I\'m trying to use an array to store a list of file names using the find command.
For some reason the array fails to work in the bash used by the school
Just don't put blanks around the equals sign:
ar=($(find . -name "*.txt"))
Avoid backticks, if possible, since they're deprecated. They can be easily confused with apostroph, especially in poor fonts, and they don't nest so well.
In most cases you will be best served if you iterate through a find-result directly with -exec, -execdir, -ok or -okdir.
For and while loops are hard to do right when it comes to blanks in filenames or newlines and tabs.
find ./ -name "*.txt" -exec grep {} ";"
The {} doesn't need masking. You will often see a combination find/xargs which starts an additional process too:
find ./ -name "*.txt" | xargs grep {} ";"