You need to use either backticks (` - not an apostrophe: ') or the $() construct to evaluate the cat /path/file? commands:
I prefer $() as it's more readable and you can nest them more easily.
I addition, to get the contents of a file into a variable, there's no need to use an external program (cat). You can simply use standard input:
The rest of the code should work ok.