Properly escape parameters to shell commands