Class ShellScript

java.lang.Object
org.verifyica.api.ShellScript

public class ShellScript extends Object
Utility class for executing shell scripts using various Unix shells.
  • Method Details

    • execute

      public static ShellScript.Result execute(ShellScript.Shell shell, Path script, Consumer<String> consumer)
      Execute a shell script using the specified shell in the current working directory.
      Parameters:
      shell - shell to use (e.g., BASH)
      script - the shell script
      consumer - consumer to handle each line of output
      Returns:
      result with exit code and optional error
    • execute

      public static ShellScript.Result execute(ShellScript.Shell shell, Path workingDirectory, Path script, Consumer<String> consumer)
      Execute a shell script using the specified shell in a given working directory.
      Parameters:
      shell - shell to use (e.g., BASH)
      workingDirectory - the directory to run the script in, or null for default
      script - the shell script
      consumer - consumer to handle each line of output
      Returns:
      result with exit code and optional error