Safer shell commands
Correctly close process on linux