Skip to content

Shell language and builtins

Strands Shell is Bourne-compatible: pipes, lists, loops, functions, subshells, and the expansions you reach for in a script all work. This page is the reference for the shell language itself and the builtins that back it, including where a construct diverges from Bash. For the external commands the shell ships (grep, curl, jq, and the rest), see the command inventory; for lua, see Lua scripting.

FeatureSupported
Pipelines and lists|, &&, ||, ;
Redirections>, >>, <, 2>, &>, here-docs <<
Conditionalsif, elif, else, case
Loopsfor, while, until
Functionsdefinitions, local variables, return
Groupingcommand groups { }, subshells ( )
Expansionvariables (${VAR:-default}, ${VAR%pat}, ${#VAR}), command substitution (`cmd`, $(cmd)), arithmetic $(( )), globs
Quotingsingle, double
Jobsbackground &
Scripts. script.sh, source
BuiltinNotable gaps
test, [No [[ ]]. Non-numeric or empty operands are treated as 0 (succeeds rather than erroring).
printfNo floating-point (%f, %e, %g print literally); %d does not parse 0x or octal prefixes.
readNo -a, -n, or -d; a prefix IFS= is ignored; -r is effectively always on.
setNo -o, so set -o pipefail fails; only e, u, and x are supported.
trapEXIT works; numeric signals (trap ... 0) are ignored; -p and -l are no-ops.
aliasCan be defined and listed, but aliases are never expanded during execution.
readonlyEnforced, but a violation returns exit 0; no -p.
localWorks within functions; silently succeeds when used outside a function.
typeNo -t or -a.
cdNo CDPATH; -P and -L are not parsed.
getopts, export, unset, shift, umask, hash, wait, :Full support.
$(( )) arithmeticPrecedence, bitwise, ternary, hex, and octal work correctly. Malformed input returns an incorrect result with exit 0 ($((2 3)) yields 2, $((1/0)) yields 0). Post-increment x++/x-- returns the value without updating the variable.

Malformed numeric input never raises: test, [, and arithmetic $(( )) treat a non-numeric or empty operand as 0, so a typo in a comparison passes silently rather than erroring.