Bash.AST.TestCommand (Bash v0.3.0)

Copy Markdown View Source

Test command for [ ... ] conditional constructs.

This represents the POSIX test command using bracket notation. The args are passed directly to the test builtin for evaluation.

Examples

# [ -f file ]
%TestCommand{
  args: ["-f", "file"]
}

# [ "$x" -eq 5 ]
%TestCommand{
  args: [%Word{...}, "-eq", "5"]
}

Summary

Types

t()

@type t() :: %Bash.AST.TestCommand{
  args: [Bash.AST.Word.t() | String.t()],
  exit_code: 0..255 | nil,
  meta: Bash.AST.Meta.t(),
  state_updates: map()
}

Functions

execute(test_command, stdin, session_state)