public static String execCommand(String[] cmd, long timeout) throws IOException {
        ShellCommandExecutor exec = new ShellCommandExecutor(cmd, timeout);
        exec.execute();
        return exec.output();
    }
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 cmd shell command to execute.
@param timeout time in milliseconds after which script should be killed. -1 means no timeout.
@return the output of the executed command.
clients/src/main/java/org/apache/kafka/common/utils/Shell.java