Every built-in, in one place
This A–Z index covers built-in commands, their subcommands, structural keywords and the eight math expression functions. User-defined functions have application-specific names and are called with call $dest name ... or directly as name ....
Syntax uses descriptive placeholders: declare $dest variables first; optional operands are in brackets. This is a syntax index, not a collection of standalone runnable programs. Open each guide for value types, permissions, error behavior and limits. Unsupported historical dll, dllimport and cgi commands are not APIs; web hosting uses the separate CGI gateway.
137 entries · Alphabetically sorted · Filter by name, purpose or category
137 entries
abs()
Math expression functions
abs(x)Absolute value. Use inside math expressions.
Full reference →args all
Structured data and utilities
args all $arrayCollect script arguments into a string array.
Full reference →args count
Structured data and utilities
args count $destCount script CLI arguments.
Full reference →args get
Structured data and utilities
args get $dest indexRead a zero-based script argument.
Full reference →array create
Core language
array create $array [value ...]Create a native string array.
Full reference →array get
Core language
array get $dest $array indexRead a zero-based item.
Full reference →array len
Core language
array len $dest $arrayCount array items.
Full reference →array pop
Core language
array pop $dest $arrayRemove and return the last item.
Full reference →array push
Core language
array push $array valueAppend a string item.
Full reference →array set
Core language
array set $array index valueReplace an existing item.
Full reference →assert
Iteration, local data and tests
assert left operator rightFail if a comparison is false.
Full reference →break
Core language
breakExit the nearest loop.
Full reference →call
Core language
call $dest name arg ...Call a user-defined function and capture its result.
Full reference →catch
Structured data and utilities
catch $errorCapture an ordinary runtime error.
Full reference →ceil()
Math expression functions
ceil(x)Round up. Use inside math expressions.
Full reference →clock
Core language
clock $destRead elapsed monotonic milliseconds.
Full reference →continue
Core language
continueAdvance the nearest loop.
Full reference →csv parse
Iteration, local data and tests
csv parse $rows $textParse CSV into JSON arrays of strings.
Full reference →csv stringify
Iteration, local data and tests
csv stringify $text $rowsSerialize string rows as CSV.
Full reference →date diff
Iteration, local data and tests
date diff $seconds $end_epoch $start_epochSubtract integral epoch seconds.
Full reference →date format
Iteration, local data and tests
date format $text $epoch zoneFormat an epoch in UTC or a fixed offset.
Full reference →date parse
Iteration, local data and tests
date parse $epoch text zoneParse a strict civil date with an explicit zone.
Full reference →db begin
Iteration, local data and tests
db begin $handleBegin a nonnested SQLite transaction.
Full reference →db close
Iteration, local data and tests
db close $handleClose SQLite and roll back pending work.
Full reference →db commit
Iteration, local data and tests
db commit $handleCommit a SQLite transaction.
Full reference →db exec
Iteration, local data and tests
db exec $changed $handle sql $paramsExecute one non-row-returning prepared statement.
Full reference →db open
Iteration, local data and tests
db open $handle pathOpen a SQLite database.
Full reference →db query
Iteration, local data and tests
db query $rows $handle sql $paramsExecute one read-only, row-returning prepared statement.
Full reference →db rollback
Iteration, local data and tests
db rollback $handleRoll back a SQLite transaction.
Full reference →do
Core language
doStart a post-test loop.
Full reference →echo
Core language
echo value ...Alias of print.
Full reference →else
Core language
elseStart the alternate branch of an if.
Full reference →end for
Core language
end forClose a numeric loop.
Full reference →end foreach
Iteration, local data and tests
end foreachClose snapshot iteration.
Full reference →end if
Core language
end ifClose an if block.
Full reference →end loop
Core language
end loopClose a pre-test loop.
Full reference →end try
Structured data and utilities
end tryClose an error handler.
Full reference →env get
Core language
env get $dest NAMERead an overlay or inherited environment value.
Full reference →env set
Core language
env set NAME valueSet a script-local environment overlay value.
Full reference →exit
Core language
exitEnd the entire script.
Full reference →file append
Structured data and utilities
file append path textAppend to a file.
Full reference →file close
Structured data and utilities
file close handleClose a streaming reader.
Full reference →file copy
Structured data and utilities
file copy source destinationCopy without replacing an existing destination.
Full reference →file create
Iteration, local data and tests
file create path textCreate a new file without clobbering an existing path.
Full reference →file exists
Structured data and utilities
file exists $dest pathTest filesystem entry existence.
Full reference →file list
Structured data and utilities
file list $array directoryList sorted directory entry names.
Full reference →file open
Structured data and utilities
file open $handle pathOpen a regular file for streaming reads.
Full reference →file read
Structured data and utilities
file read $dest pathRead a bounded regular file.
Full reference →file readline
Structured data and utilities
file readline $line $eof handleRead the next bounded file line.
Full reference →file rename
Structured data and utilities
file rename source destinationRename without replacing an existing destination.
Full reference →file write
Structured data and utilities
file write path textWrite a file, truncating existing contents.
Full reference →find
Core language
find $dest text needleFind first byte offset, or -1.
Full reference →floor()
Math expression functions
floor(x)Round down. Use inside math expressions.
Full reference →for
Core language
for $i start end [step]Iterate a numeric range with exclusive end.
Full reference →foreach
Iteration, local data and tests
foreach $value $sourceIterate a snapshot; optional key destination precedes value.
Full reference →function
Core language
function name argcDeclare a function; named parameters are also supported.
Full reference →goto
Core language
goto labelJump to an already visited point in the same scope.
Full reference →http get
Structured data and utilities
http get $body $status url timeout_ms max_response_bytesMake a bounded HTTP/S GET.
Full reference →http post
Structured data and utilities
http post $body $status url timeout_ms max_response_bytes request_bodyMake a bounded HTTP/S POST.
Full reference →if
Core language
if left operator rightStart a conditional block.
Full reference →include
Core language
include pathLoad function definitions from another source file.
Full reference →input
Structured data and utilities
input $line $eofRead a line from standard input.
Full reference →join
Core language
join $dest $array delimiterJoin native string array elements.
Full reference →json get
Structured data and utilities
json get $dest $json keyOrIndexRead a JSON member or array item.
Full reference →json parse
Structured data and utilities
json parse $dest textParse typed JSON.
Full reference →json string
Structured data and utilities
json string $dest textWrap scalar text as a JSON string.
Full reference →json stringify
Structured data and utilities
json stringify $dest $jsonEncode a JSON value as text.
Full reference →json text
Structured data and utilities
json text $dest $jsonExtract a primitive JSON value as scalar text.
Full reference →json type
Structured data and utilities
json type $dest $jsonReport the JSON type.
Full reference →kill
Core language
kill nameEnd a function declaration.
Full reference →len
Core language
len $dest textReturn byte length.
Full reference →loop
Core language
loop left operator rightStart a pre-test loop.
Full reference →lower
Core language
lower $dest textConvert ASCII letters to lowercase.
Full reference →map create
Structured data and utilities
map create $mapCreate an empty JSON object.
Full reference →map get
Structured data and utilities
map get $dest $map keyRead an object member.
Full reference →map has
Structured data and utilities
map has $dest $map keyTest object membership.
Full reference →map keys
Structured data and utilities
map keys $array $mapList sorted keys as a string array.
Full reference →map remove
Structured data and utilities
map remove $map keyRemove an object member.
Full reference →map set
Structured data and utilities
map set $map key valueAdd or replace an object member.
Full reference →math
Core language
math $dest expressionEvaluate a finite numeric expression.
Full reference →max()
Math expression functions
max(a,b)Maximum of two values. Use inside math expressions.
Full reference →min()
Math expression functions
min(a,b)Minimum of two values. Use inside math expressions.
Full reference →point
Core language
point labelRecord a visited jump point.
Full reference →pow()
Math expression functions
pow(a,b)Raise a to power b. Use inside math expressions.
Full reference →Core language
print value ...Write values without an implicit newline.
Full reference →random
Core language
random $dest low highGenerate a non-cryptographic integer in an inclusive range.
Full reference →random seed
Core language
random seed integerSeed the deterministic random generator.
Full reference →replace
Core language
replace $dest text needle replacementReplace nonoverlapping matches.
Full reference →return
Core language
return value ...Return concatenated scalar text.
Full reference →returnvalue
Iteration, local data and tests
returnvalue valueReturn a value while preserving its type.
Full reference →round()
Math expression functions
round(x)Round halfway away from zero. Use inside math expressions.
Full reference →set
Core language
set $dest value ...Concatenate scalar values into a destination.
Full reference →socket accept
Stream networking
socket accept $connection $listener timeout_msAccept an incoming stream.
Full reference →socket close
Stream networking
socket close $connectionClose a stream or listener.
Full reference →socket connect
Stream networking
socket connect $connection host port timeout_msConnect a TCP stream.
Full reference →socket endpoint
Stream networking
socket endpoint $address $port $connectionRead the local endpoint.
Full reference →socket handshake
Nonblocking networking and UDP
socket handshake $result $connectionAdvance a server TLS handshake.
Full reference →socket listen
Stream networking
socket listen $listener address port backlogCreate a TCP listener.
Full reference →socket readline
Stream networking
socket readline $data $eof $connection maxbytes timeout_msReceive a bounded line.
Full reference →socket recv
Stream networking
socket recv $data $eof $connection maxbytes timeout_msReceive stream bytes.
Full reference →socket sendall
Stream networking
socket sendall $connection data timeout_msSend all bytes within the bounded operation.
Full reference →socket tlsconnect
Stream networking
socket tlsconnect $connection host port timeout_msConnect with verified TLS.
Full reference →socket tlslisten
Nonblocking networking and UDP
socket tlslisten $listener address port backlogCreate a TLS listener using operator credentials.
Full reference →socket tryaccept
Nonblocking networking and UDP
socket tryaccept $result $connection $listener handshake_msAttempt a nonblocking accept.
Full reference →socket tryrecv
Nonblocking networking and UDP
socket tryrecv $result $data $connection maxbytesAttempt a nonblocking read.
Full reference →socket trysend
Nonblocking networking and UDP
socket trysend $result $connection dataAttempt or resume a nonblocking write.
Full reference →socket wait
Nonblocking networking and UDP
socket wait $events $interests timeout_msWait for readiness on selected handles.
Full reference →split
Core language
split $array text delimiterSplit into a native string array.
Full reference →sql begin
Remote SQL
sql begin $handleBegin a remote transaction.
Full reference →sql close
Remote SQL
sql close $handleClose the connection and roll back ordinary pending work.
Full reference →sql commit
Remote SQL
sql commit $handleCommit a remote transaction.
Full reference →sql exec
Remote SQL
sql exec $affected $handle sql $paramsExecute a prepared non-row-returning statement.
Full reference →sql open
Remote SQL
sql open $handle driver profile-nameOpen a mysql, mariadb or mssql profile.
Full reference →sql query
Remote SQL
sql query $rows $handle sql $paramsExecute a prepared row-returning statement; not a read-only guarantee.
Full reference →sql rollback
Remote SQL
sql rollback $handleRoll back a remote transaction.
Full reference →sqrt()
Math expression functions
sqrt(x)Square root. Use inside math expressions.
Full reference →substr
Core language
substr $dest text start lengthExtract a byte-based substring.
Full reference →trim
Core language
trim $dest textRemove surrounding ASCII whitespace.
Full reference →try
Structured data and utilities
tryBegin a recoverable-error handler.
Full reference →udp bind
Nonblocking networking and UDP
udp bind $handle address portBind a UDP socket.
Full reference →udp close
Nonblocking networking and UDP
udp close $handleClose a UDP socket.
Full reference →udp endpoint
Nonblocking networking and UDP
udp endpoint $address $port $handleRead a UDP local endpoint.
Full reference →udp recvfrom
Nonblocking networking and UDP
udp recvfrom $result $data $handle maxbytesReceive a datagram and metadata.
Full reference →udp sendto
Nonblocking networking and UDP
udp sendto $result $handle address port dataSend a datagram.
Full reference →upper
Core language
upper $dest textConvert ASCII letters to uppercase.
Full reference →var
Core language
var name ...Declare local variables.
Full reference →web escape
CGI response API
web escape $dest textEscape text for HTML output.
Full reference →web header
CGI response API
web header name valueSet a validated response header.
Full reference →web request
CGI response API
web request $destRead structured CGI request data in worker mode.
Full reference →web status
CGI response API
web status codeSet the buffered HTTP response status.
Full reference →websocket abort
WebSockets
websocket abort $connectionImmediately release a WebSocket connection.
Full reference →websocket client
WebSockets
websocket client $result $connection $config timeout_msBegin a client upgrade on an established stream.
Full reference →websocket close
WebSockets
websocket close $result $connection code reason timeout_msBegin a bounded closing handshake.
Full reference →websocket send
WebSockets
websocket send $result $connection type dataQueue text, binary or ping data.
Full reference →websocket server
WebSockets
websocket server $result $connection $config timeout_msBegin a server upgrade on an established stream.
Full reference →websocket step
WebSockets
websocket step $result $data $connectionAdvance handshake, messages or closing.
Full reference →while
Core language
while left operator rightClose and test a do loop.
Full reference →