Pass through "env" in cmd.script

Fixes #9002.
Merge pull request #9027 from terminalmage/issue9002

Pass through "env" in cmd.script