Escape single quotes in arguments and quote them when calling system().