Fixed shell statement
Fixed shell statement

A few things:
* equality statements need "-" in front of the check type
* Changed to != 0 to catch more errors
* Added error echo
rgardler/simdem,rgardler/simdem,rgardler/simdem,rgardler/simdem