code: def sh2(cmd):
      
      p = Popen(cmd, stdout=PIPE, shell=True, env=sub_environment())
      out = p.communicate()[0]
      retcode = p.returncode
      if retcode:
          raise CalledProcessError(retcode, cmd)
      else:
          return out.rstrip()
docs: Execute command in a subshell, return stdout.
  
      Stderr is unbuffered from the subshell.x