Source:
<code>public InterpreterResult interpret(String cmd, InterpreterContext contextInterpreter) { LOGGER.debug("Run shell command '" + cmd + "'"); OutputStream outStream = new ByteArrayOutputStream(); CommandLine cmdLine = CommandLine.parse(shell); if (isWindows) { String[] lines = StringUtils.split(cmd, "\n"); cmd = StringUtils.join(lines, " && "); } cmdLine.addArgument(cmd, false); try { DefaultExecutor executor = new DefaultExecutor(); executor.setStreamHandler(new PumpStreamHandler( contextInterpreter.out, contextInterpreter.out)); executor.setWatchdog(new ExecuteWatchdog(Long.valueOf(getProperty(TIMEOUT_PROPERTY)))); executors.put(contextInterpreter.getParagraphId(), executor); <START> executor.setWorkingDirectory(new File(System.getenv("HOME"))); <END> int exitVal = executor.execute(cmdLine); LOGGER.info("Paragraph " + contextInterpreter.getParagraphId() + " return with exit value: " + exitVal); return new InterpreterResult(Code.SUCCESS, outStream.toString()); } catch (ExecuteException e) { int exitValue = e.getExitValue(); LOGGER.error("Can not run " + cmd, e); Code code = Code.ERROR; String message = outStream.toString(); if (exitValue == 143) { code = Code.INCOMPLETE; message += "Paragraph received a SIGTERM\n"; LOGGER.info("The paragraph " + contextInterpreter.getParagraphId() + " stopped executing: " + message); } message += "ExitValue: " + exitValue; return new InterpreterResult(code, message); } catch (IOException e) { LOGGER.error("Can not run " + cmd, e); return new InterpreterResult(Code.ERROR, e.getMessage()); } finally { executors.remove(contextInterpreter.getParagraphId()); } }</code><technical_language>this work in windows (well)</technical_language>

Target:
public InterpreterResult interpret(String cmd, InterpreterContext contextInterpreter) { LOGGER.debug("Run shell command '" + cmd + "'"); OutputStream outStream = new ByteArrayOutputStream(); CommandLine cmdLine = CommandLine.parse(shell); if (isWindows) { String[] lines = StringUtils.split(cmd, "\n"); cmd = StringUtils.join(lines, " && "); } cmdLine.addArgument(cmd, false); try { DefaultExecutor executor = new DefaultExecutor(); executor.setStreamHandler(new PumpStreamHandler( contextInterpreter.out, contextInterpreter.out)); executor.setWatchdog(new ExecuteWatchdog(Long.valueOf(getProperty(TIMEOUT_PROPERTY)))); executors.put(contextInterpreter.getParagraphId(), executor); executor.setWorkingDirectory(new File(System.getProperty("user.home"))); int exitVal = executor.execute(cmdLine); LOGGER.info("Paragraph " + contextInterpreter.getParagraphId() + " return with exit value: " + exitVal); return new InterpreterResult(Code.SUCCESS, outStream.toString()); } catch (ExecuteException e) { int exitValue = e.getExitValue(); LOGGER.error("Can not run " + cmd, e); Code code = Code.ERROR; String message = outStream.toString(); if (exitValue == 143) { code = Code.INCOMPLETE; message += "Paragraph received a SIGTERM\n"; LOGGER.info("The paragraph " + contextInterpreter.getParagraphId() + " stopped executing: " + message); } message += "ExitValue: " + exitValue; return new InterpreterResult(code, message); } catch (IOException e) { LOGGER.error("Can not run " + cmd, e); return new InterpreterResult(Code.ERROR, e.getMessage()); } finally { executors.remove(contextInterpreter.getParagraphId()); } }