Builtins Reference
Builtins Reference
This section is a glossary of Murex builtin commands.
Because Murex is loosely modelled on the functional paradigm, it means all language constructs are exposed via functions and those are typically builtins because they can share the Murex runtime virtual machine. However any executable command can also be called from within Murex; be that either via the exec
builtin or natively like you would from any Linux, UNIX, or even Windows command prompt.
Other Reference Material
Language Guides
Language Tour, which is an introduction into the Murex language.
Rosetta Stone, which is a reference table comparing Bash syntax to Murex's.
Murex's Source Code
The source for each of these builtins can be found on Github.
Shell Commands For Querying Builtins
From the shell itself: run builtins
to list the builtin command.
If you require a manual on any of those commands, you can run murex-docs
to return the same markdown-formatted document as those listed below. eg
murex-docs trypipe
Pages
2darray
: Create a 2D JSON array from multiple input sources<stdin>
: Read the STDIN belonging to the parent code block@g
(autoglob) : Command prefix to expand globbing (deprecated)a
(mkarray): A sophisticated yet simple way to build an array or listaddheading
: Adds headings to a tablealias
: Create an alias for a commandalter
: Change a value within a structured data-type and pass that change along the pipeline without altering the original source inputand
: Returnstrue
orfalse
depending on whether multiple conditions are metappend
: Add data to the end of an arrayargs
: Command line flag parser for Murex shell scriptingautocomplete
: Set definitions for tab-completion in the command linebexists
: Check which builtins existbg
: Run processes in the backgroundbreak
: Terminate execution of a block within your processes scopecast
: Alters the data type of the previous function without altering it's outputcatch
: Handles the exception code raised bytry
ortrypipe
cd
: Change (working) directoryconfig
: Query or define Murex runtime settingscontinue
: Terminate process of a block within a caller functioncount
: Count items in a map, list or arraycpuarch
: Output the hosts CPU architecturecpucount
: Output the number of CPU cores available on your hostdatetime
: A date and/or time conversion tool (likeprintf
but for date and time values)debug
: Debugging informationdie
: Terminate murex with an exit number of 1err
: Print a line to the STDERRescape
: Escape or unescape inputesccli
: Escapes an array so output is valid shell codeeschtml
: Encode or decodes text for HTMLescurl
: Encode or decodes text for the URLevent
: Event driven programming for shell scriptsexec
: Runs an executableexit
: Exit murexexitnum
: Output the exit number of the previous processexport
: Define an environmental variable and set it's valueexpr
: Expressions: mathematical, string comparisons, logical operatorsf
: Lists or filters file system objects (eg files)false
: Returns afalse
valuefexec
: Execute a command or function, bypassing the usual order of precedence.fg
: Sends a background process into the foregroundfid-kill
: Terminate a running Murex functionfid-killall
: Terminate all running Murex functionsfid-list
: Lists all running functions within the current Murex sessionfor
: A more familiar iteration loop to existing developersforeach
: Iterate through an arrayformap
: Iterate through a map or other collection of dataformat
: Reformat one data-type into another data-typefunction
: Define a function blockg
: Glob pattern matching for file system objects (eg*.txt
)get-type
: Returns the data-type of a variable or pipeget
: Makes a standard HTTP request and returns the result as a JSON objectgetfile
: Makes a standard HTTP request and return the contents as Murex-aware data type for passing along Murex pipelines.global
: Define a global variable and set it's valuehistory
: Outputs murex's command historyif
: Conditional statement to execute different blocks of code depending on the result of the conditionja
(mkarray): A sophisticated yet simply way to build a JSON arrayjsplit
: Splits STDIN into a JSON array based on a regex parameterleft
: Left substring every item in a listlet
: Evaluate a mathematical function and assign to variable (deprecated)lockfile
: Create and manage lock filesman-get-flags
: Parses man page files for command line flagsman-summary
: Outputs a man page summary of a commandmap
: Creates a map from two data sourcesmatch
: Match an exact value in an arraymethod
: Define a methods supported data-typesmsort
: Sorts an array - data type agnosticmtac
: Reverse the order of an arraymurex-docs
: Displays the man pages for Murex builtinsmurex-package
: Murex's package managermurex-parser
: Runs the Murex parser against a block of codemurex-update-exe-list
: Forces Murex to rescan $PATH looking for executablesnull
: null function. Similar to /dev/nullopen-image
: Renders bitmap image data on your terminalopen
: Open a file with a preferred handleropenagent
: Creates a handler function foropen
or
: Returnstrue
orfalse
depending on whether one code-block out of multiple ones supplied is successful or unsuccessful.os
: Output the auto-detected OS nameout
: Print a string to the STDOUT with a trailing new line characterpipe
: Manage Murex named pipespost
: HTTP POST request with a JSON-parsable returnprefix
: Prefix a string to every item in a listprepend
: Add data to the start of an arraypretty
: Prettifies JSON to make it human readableprivate
: Define a private function blockpt
: Pipe telemetry. Writes data-types and bytes writtenrand
: Random field generatorread
:read
a line of input from the user and store as a variableregexp
: Regexp tools for arrays / lists of stringsreturn
: Exits current function scoperight
: Right substring every item in a listround
: Round a number by a user defined precisionrunmode
: Alter the scheduler's behaviour at higher scoping levelruntime
: Returns runtime information on the internal state of Murexrx
: Regexp pattern matching for file system objects (eg.*\\.txt
)set
: Define a local variable and set it's valuesignal
: Sends a signal RPCsource
: Import Murex code from another file of code blockstruct-keys
: Outputs all the keys in a structure as a file pathsuffix
: Prefix a string to every item in a listsummary
: Defines a summary help text for a commandswitch
: Blocks of cascading conditionalsta
(mkarray): A sophisticated yet simple way to build an array of a user defined data-typetabulate
: Table transformation toolstest
: Murex's test framework - define tests, run tests and debug shell scriptstime
: Returns the execution run time of a command or blocktmp
: Create a temporary file and write to ittout
: Print a string to the STDOUT and set it's data-typetread
:read
a line of input from the user and store as a user defined typed variable (deprecated)true
: Returns atrue
valuetry
: Handles errors inside a block of codetrypipe
: Checks state of each function in a pipeline and exits block on errortype
: Command type (function, builtin, alias, etc)version
: Get Murex versionwhich
: Locate command originwhile
: Loop until condition false