public static String execCommand(Map<String, String> env, String[] cmd,
                                     long timeout) throws IOException {
        ShellCommandExecutor exec = new ShellCommandExecutor(cmd, null, env,
                                                             timeout);
        exec.execute();
        return exec.getOutput();
    }
public static String execCommand ( Map < String , String > env , String [ ] cmd , long timeout ) throws IOException { ShellCommandExecutor exec = new ShellCommandExecutor ( cmd , null , env , timeout ) ; exec . execute ( ) ; return exec . getOutput ( ) ; }
Static method to execute a shell command. Covers most of the simple cases without requiring the user to implement the <code>Shell</code> interface.

@param env the map of environment key=value
@param cmd shell command to execute.
@param timeout time in milliseconds after which script should be marked timeout
@return the output of the executed command.o