private void setupEnv(Cmd cmd, Process p) throws ShellException {
Map enviro = cmd.getEnvironment();
if(enviro != null) {
Iterator eit = enviro.entrySet().iterator();
EnvProperties penv = p.getEnv();
while(eit.hasNext()) {
Map.Entry ent = (Map.Entry) eit.next();
penv.setEnvProperty((String) ent.getKey(), (String) ent.getValue());
}
}
}