boolean (int pid) { List<String> commands = new ArrayList<>(); commands.add("/bin/sh"); commands.add("-c"); commands.add(String.format(GET_PROCESS_USER, pid)); try { return myHost.getProcessOutput(new GeneralCommandLine(commands)).getStdout().trim().equals(getenv("USER")); } catch (Exception e) { LOGGER.warn("Failed to compare users", e); return false; } }