Class Shell

java.lang.Object
fi.evolver.script.Shell

public class Shell extends Object
  • Field Details

    • HOME

      public static final Path HOME
    • BASHRC

      public static final Path BASHRC
    • USER

      public static final String USER
  • Constructor Details

    • Shell

      public Shell()
  • Method Details

    • setGlobalLogWriter

      public static void setGlobalLogWriter(Writer globalLogWriter)
    • user

      public static String user(String... command)
      Run an external command as the current user. Fails on non-zero exit value.
      Parameters:
      command - The command to run.
      Returns:
      Standard output returned by the program.
    • user

      public static String user(List<String> command)
      Run an external command as the current user. Fails on non-zero exit value.
      Parameters:
      command - The command to run.
      Returns:
      Standard output returned by the program.
    • sudo

      public static String sudo(String... command)
      Run an external command with root privileges. Fails on non-zero exit value.
      Parameters:
      command - The command to run.
      Returns:
      Standard output returned by the program.
    • sudo

      public static String sudo(List<String> command)
      Run an external command with root privileges. Fails on non-zero exit value.
      Parameters:
      command - The command to run.
      Returns:
      Standard output returned by the program.