Profile the cmd via exec() with the specified global and local environment.
profile/Profile.runctx
Profile.runctx