Fix for Bug 901404

* syntax error in bash code
* Added /tmp to directory for mktemp