Documentation ¶
Overview ¶
Package pogosh implements a small POSIX-compatible shell.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultBuiltins ¶
DefaultBuiltins lists all the available builtins.
Types ¶
type Arithmetic ¶
type Arithmetic struct {
// contains filtered or unexported fields
}
Arithmetic computes value in $((...)) expression. TODO: why public?
type Overrides ¶
Overrides change the behaviour of builtins.
func DefaultOverrides ¶
func DefaultOverrides() Overrides
DefaultOverrides creates a new default overrides.
type State ¶
type State struct { IsInteractive bool Builtins map[string]func(*State, *Cmd) Aliases map[string]string Overrides Overrides // contains filtered or unexported fields }
State holds data on the current interpreter execution.
func (*State) Run ¶
Run executes the given fragment of shell.
There are three circumstances for this function to return:
1. There is a shell error (compiler error, file not found, ...) 2. The script calls the exit builtin. 3. The script reaches the end of input.
In the case the shell script execs another process, this function will not return (unless the Exec function is appropriately overriden).