Bash.AST.Pipeline (Bash v0.3.0)

Copy Markdown View Source

Pipeline: sequence of commands connected by pipes (|).

Examples

# ls | grep txt | wc -l
%Pipeline{
  commands: [
    %Command{name: "ls", ...},
    %Command{name: "grep", args: ["txt"], ...},
    %Command{name: "wc", args: ["-l"], ...}
  ]
}

# ! grep pattern file
%Pipeline{
  commands: [%Command{name: "grep", ...}],
  negate: true
}

Summary

Types

t()

@type t() :: %Bash.AST.Pipeline{
  commands: [Bash.AST.Command.t()],
  exit_code: 0..255 | nil,
  meta: Bash.AST.Meta.t(),
  negate: boolean(),
  pipestatus: [0..255] | nil,
  state_updates: map()
}

Functions

execute(pipeline, stdin, session_state, opts \\ [])