class Shell {

  public static String[] getSignalKillCommand(int code, String pid) {
    // Code == 0 means check alive
    if (Shell.WINDOWS) {
      if (0 == code) {
        return new String[] {Shell.getWinUtilsPath(), "task", "isAlive", pid };
      } else {
        return new String[] {Shell.getWinUtilsPath(), "task", "kill", pid };
      }
    }

    if (isSetsidAvailable) {
      // Use the shell-builtin as it support "--" in all Hadoop supported OSes
      return new String[] { "bash", "-c", "kill -" + code + " -- -" + pid };
    } else {
      return new String[] { "bash", "-c", "kill -" + code + " " + pid };
    }
  }

  protected  Shell();
  protected  Shell(long interval);
  protected  Shell(long interval, boolean redirectErrorStream);

}