Package org.apache.groovy.groovysh.jline

# Class GroovyPosixCommands

java.lang.Object
org.apache.groovy.groovysh.jline.GroovyPosixCommands

public class GroovyPosixCommands extends Object
Groovy-aware implementations of groovysh POSIX-style commands.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GroovyPosixCommands()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static void`
  `cat(org.jline.builtins.PosixCommands.Context context, Object[] argv)`
  Writes the supplied files, variables, or standard input to the current output stream.
  `static void`
  `grep(org.jline.builtins.PosixCommands.Context context, Object[] argv)`
  Searches the selected inputs for lines matching the supplied pattern.
  `static void`
  `head(org.jline.builtins.PosixCommands.Context context, Object[] argv)`
  Prints the beginning of each requested input.
  `static void`
  `less(org.jline.builtins.PosixCommands.Context context, String[] argv)`
  Displays the requested inputs in the less viewer, or streams them when not interactive.
  `static void`
  `ls(org.jline.builtins.PosixCommands.Context context, Object[] argv)`
  Lists directory entries using the current groovysh working directory.
  `static void`
  `sort(org.jline.builtins.PosixCommands.Context context, Object[] argv)`
  Sorts the requested inputs and writes the ordered lines to the current output.
  `static void`
  `tail(org.jline.builtins.PosixCommands.Context context, Object[] argv)`
  Prints the end of each requested input.
  `static void`
  `wc(org.jline.builtins.PosixCommands.Context context, Object[] argv)`
  Counts lines, words, characters, or bytes for the selected inputs.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### GroovyPosixCommands

    public GroovyPosixCommands()

- ## Method Details

  - ### cat

    public static void cat(org.jline.builtins.PosixCommands.Context context, Object[] argv) throws Exception
    Writes the supplied files, variables, or standard input to the current output stream.
    Parameters:
      `context` - command execution context
      `argv` - command name and arguments
    Throws:
      `Exception` - if an input cannot be resolved or read

  - ### wc

    public static void wc(org.jline.builtins.PosixCommands.Context context, Object[] argv) throws Exception
    Counts lines, words, characters, or bytes for the selected inputs.
    Parameters:
      `context` - command execution context
      `argv` - command name and arguments
    Throws:
      `Exception` - if an input cannot be processed

  - ### head

    public static void head(org.jline.builtins.PosixCommands.Context context, Object[] argv) throws Exception
    Prints the beginning of each requested input.
    Parameters:
      `context` - command execution context
      `argv` - command name and arguments
    Throws:
      `Exception` - if an input cannot be read

  - ### tail

    public static void tail(org.jline.builtins.PosixCommands.Context context, Object[] argv) throws Exception
    Prints the end of each requested input.
    Parameters:
      `context` - command execution context
      `argv` - command name and arguments
    Throws:
      `Exception` - if an input cannot be read

  - ### ls

    public static void ls(org.jline.builtins.PosixCommands.Context context, Object[] argv) throws Exception
    Lists directory entries using the current groovysh working directory.
    Parameters:
      `context` - command execution context
      `argv` - command name and arguments
    Throws:
      `Exception` - if the listing cannot be produced

  - ### grep

    public static void grep(org.jline.builtins.PosixCommands.Context context, Object[] argv) throws Exception
    Searches the selected inputs for lines matching the supplied pattern.
    Parameters:
      `context` - command execution context
      `argv` - command name and arguments
    Throws:
      `Exception` - if the search cannot be completed

  - ### sort

    public static void sort(org.jline.builtins.PosixCommands.Context context, Object[] argv) throws Exception
    Sorts the requested inputs and writes the ordered lines to the current output.
    Parameters:
      `context` - command execution context
      `argv` - command name and arguments
    Throws:
      `Exception` - if an input cannot be read or sorted

  - ### less

    public static void less(org.jline.builtins.PosixCommands.Context context, String[] argv) throws Exception
    Displays the requested inputs in the less viewer, or streams them when not interactive.
    Parameters:
      `context` - command execution context
      `argv` - command name and arguments
    Throws:
      `Exception` - if the viewer cannot be initialized or an input cannot be opened