Fix evaluation of command outputs

Bash doesn't know boolean variables, nor does test (which is what gets called when you use [ ]). This edit returns values that can be properly evaluated.