API Reference Bash v#0.6.0

Copy Markdown View Source

Modules

A Bash interpreter written in pure Elixir.

Typed Abstract Syntax Tree (AST) for Bash.

Arithmetic expression for (( ... )) constructs.

Array assignment statement.

Variable assignment.

Brace expansion AST node.

Case statement: pattern matching.

Simple command: name with arguments and optional redirections.

Comment for # ... constructs.

Compound statement: subshell or command group.

Coproc AST node.

for NAME [in WORDS ... ] ; do COMMANDS; done

Function definition.

Conditional statement: if/elif/else/fi.

Source location metadata attached to every AST node. Used for error reporting, debugging, and execution tracking.

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

I/O redirection.

Regex pattern for use with the =~ operator in [[ ]] test expressions.

Test command for [ ... ] conditional constructs.

Test expression for [[ ... ]] conditional constructs.

Variable reference with optional parameter expansion operators.

Protocol for traversing and transforming AST nodes.

While or until loop.

Word: expandable text that may contain variables, command substitutions, etc.

Evaluates bash arithmetic expressions.

Central registry for Bash builtin commands and reserved words.

alias [-p] [name[=value] ... ]

bg [job_spec ...]

break [n]

builtin [shell-builtin [arg ...]]

caller [EXPR]

cd [-L|-P] [dir]

Null command.

command [-pVv] command [arg ...]

complete [-abcdefgjksuv] [-pr] [-o option] [-A action] [-G globpat] [-W wordlist] [-P prefix] [-S suffix] [-X filterpat] [-F function] [-C command] [name ...]

continue [n] Resume for, while, or until loops.

coproc [NAME] command [redirections]

declare [-afFirtx] [-p] [name[=value] ...]

dirs [-clpv] [+N] [-N] Display directory stack.

disown [-h] [-ar] [jobspec ... | pid ...]

echo [-neE] [arg ...]

enable [-a] [-dnps] [-f filename] [name ...]

eval [arg ...]

exec [-cl] [-a name] [command [argument ...]]

export [-fn] [name[=value] ...] or export -p [-f] Set export attribute for shell variables.

Return an unsuccessful result.

fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [cmd]

fg [job_spec]

getopts optstring name [arg]

hash [-lr] [-p pathname] [-dt] [name ...]

help [-dms] [pattern ...]

history [-c] [-d offset] [n] or history -awrn [filename] or history -ps arg [arg...]

jobs [-lnprs] [jobspec ...] or jobs -x command [args]

kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]

let arg [arg ...] (( expression ))

local [option] name[=value] ...

mapfile [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]

popd [-n] [+N | -N] Remove entries from the directory stack.

printf [-v var] format [arguments]

pushd [-n] [dir | +N | -N] Add directories to the directory stack.

pwd [-LP]

read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p prompt] [-t timeout] [-u fd] [name ...]

readonly [-aAf] [name[=value] ...] or readonly -p

return [n]

set [--abefhkmnptuvxBCHP] [-o option] [arg ...]

shift [n]

shopt [-pqsu] [-o] [optname ...]

source filename [arguments]

suspend [-f]

test [expr]

Implementation of the POSIX test builtin.

trap [-lp] [arg signal_spec ...]

Return a successful result.

type [-afptP] name [name ...]

ulimit [-SHacdfilmnpqstuvx] [limit]

umask [-p] [-S] [mode]

unalias [-a] name [name ...]

unset [-fvn] [name ...]

Handler for builtins that are not supported in this implementation.

wait [n ...]

Policy engine for controlling command execution and filesystem access.

Single interface for all user-facing OS process execution.

Represents the result of executing a command.

Unified execution context for defbash functions in both builtins and interop.

Exception raised when a string cannot be safely escaped for a Bash context.

Represents a single command execution with its own I/O streams.

Protocol for extracting execution results from various result types.

Executes parsed Bash AST nodes within session context.

Behaviour and dispatcher for pluggable filesystem implementations.

In-memory filesystem implementation backed by an ETS table.

Default filesystem implementation that delegates to the host OS filesystem.

Mix formatter plugin for Bash scripts and sigils.

Define Elixir functions callable from Bash scripts.

Normalized result from an Elixir interop function call.

Represents a background job in a Bash session.

GenServer wrapping a background OS process.

GenServer for managing orphaned/disowned jobs.

Recursive descent parser for Bash scripts.

Parser for bash arithmetic expressions.

Hand-written parser and expander for Bash variable expansions.

BEAM-native pipe that buffers data between a writer and reader using blocked GenServer.call/3.

GenServer managing process substitution execution.

Top-level script: a sequence of statements with separators.

Session GenServer for maintaining Bash execution context.

Opaque handle to an in-flight execution.

Sigil implementation for ~BASH.

Output sink functions for streaming command output.

Type definition for executable Bash statements.

Exception raised when bash script parsing or validation fails.

Telemetry instrumentation for the Bash interpreter.

Lexer for Bash syntax.

Bash variable with attributes and value. Supports scalar values, indexed arrays, and associative arrays.

Mix Tasks

Formats Bash script files.

Validates Bash script files for syntax errors.