This section contains miscellaneous documents on using and configuring the shell and Murex’s numerous features.
The Language Tour is a great introduction into the Murex language.
&&
) Logical Operator: Continues next operation if previous operation passes>>
) Token: Redirects STDOUT to a file and append its contents@
) Token: Expand values as an array->
) Token: Pipes STDOUT from the left hand command to STDIN of the right hand command%(
, )
) Tokens: Initiates or terminates a string (variables expanded)%[]
) constructor: Quickly generate arrays{
, }
) Tokens: Initiates or terminates a code block"
) Token: Initiates or terminates a string (variables expanded)=>
) Token: Pipes a reformatted STDOUT stream from the left hand command to STDIN of the right hand command||
) Logical Operator: Continues next operation only if previous operation fails|
) Token: Pipes STDOUT from the left hand command to STDIN of the right hand command?
) Token: Pipes STDERR from the left hand command to STDIN of the right hand command'
) Token: Initiates or terminates a string (variables not expanded)$
) Token: Expand values as a string~
) Token: Home directory path variable!
(not): Reads the STDIN and exit number from previous process and not’s it’s condition(
(brace quote): Write a string to the STDOUT without new line2darray
: Create a 2D JSON array from multiple input sources<>
/ read-named-pipe
: Reads from a Murex named pipe<stdin>
: Read the STDIN belonging to the parent code block=
(arithmetic evaluation): Evaluate a mathematical function (deprecated)>>
(append file): Writes STDIN to disk - appending contents if file already exists>
(truncate file): Writes STDIN to disk - overwriting contents if file already exists@g
(autoglob): Command prefix to expand globbing (deprecated)[[
(element): Outputs an element from a nested structure[
(index): Outputs an element from an array, map or table[
(range): Outputs a ranged subset of data from STDINa
(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
: Returns true
or false
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 by try
or trypipe
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 (like printf
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 a false
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 exectablesnull
: 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 for `openor
: Returns true
or false
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 stringsright
: Right substring every item in a listrunmode
: 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 valuesource
: 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 a true
valuetry
: Handles errors inside a block of codetrypipe
: Checks state of each function in a pipeline and exits block on errorversion
: Get Murex versionwhile
: Loop until condition falseThese builtins are optional. select
is included as part of the default build but can be disabled without breaking functionality. The other optional builtins are only included by default on Windows.
!bz2
: Decompress a bz2 filebase64
: Encode or decode a base64 stringgz
: Compress or decompress a gzip fileqr
: Creates a QR code from STDINselect
: Inlining SQL into shell pipelinessleep
: Suspends the shell for a number of seconds*
(generic): generic (primitive)bool
: Boolean (primitive)commonlog
: Apache httpd “common” log formatcsv
: CSV files (and other character delimited tables)float
(floating point number): Floating point number (primitive)hcl
: HashiCorp Configuration Language (HCL)int
: Whole number (primitive)json
: JavaScript Object Notation (JSON)jsonc
: Concatenated JSONjsonl
: JSON Linesnum
(number): Floating point number (primitive)str
(string): string (primitive)toml
: Tom’s Obvious, Minimal Language (TOML)yaml
: YAML Ain’t Markup Language (YAML)These API docs are provided for any developers wishing to write their own builtins.
Marshal()
(type): Converts structured memory into a structured file format (eg for stdio)ReadArray()
(type): Read from a data type one array element at a timeReadArrayWithType()
(type): Read from a data type one array element at a time and return the elements contents and data typeReadIndex()
(type): Data type handler for the index, [
, builtinReadMap()
(type): Treat data type as a key/value structure and read its contentsReadNotIndex()
(type): Data type handler for the bang-prefixed index, ![
, builtinUnmarshal()
(type): Converts a structured file format into structured memoryWriteArray()
(type): Write a data type, one array element at a timelang.ArrayTemplate()
(template API): Unmarshals a data type into a Go struct and returns the results as an arraylang.ArrayWithTypeTemplate()
(template API): Unmarshals a data type into a Go struct and returns the results as an array with data type includedlang.IndexTemplateObject()
(template API): Returns element(s) from a data structurelang.IndexTemplateTable()
(template API): Returns element(s) from a tablelang.MarshalData()
(system API): Converts structured memory into a Murex data-type (eg for stdio)lang.UnmarshalData()
(system API): Converts a Murex data-type into structured memoryThis site's content is rebuilt automatically from murex's source code after each merge to the master
branch. Downloadable murex binaries are also built with the website.
Last built on Fri May 19 22:45:48 UTC 2023 against commit 54b5f6754b5f67b250bbf7353e83c42ed187802584c3ae3.
Current version is 4.1.6140 which has been verified against 14045 tests cases.