Rewrite env command to shell version, this is faster.