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.
[ ..Range ]
: Outputs a ranged subset of data from
stdin[ Index ]
): Outputs an element from an array, map or
table[[ Element ]]
): Outputs an element from a nested
structure<pipe>
): Reads from a Murex named pipe<stdin>
): Read the stdin belonging to the parent
code block>
): Writes stdin to disk - overwriting contents if
file already exists"Double Quote"
:
Initiates or terminates a string (variables expanded)$Scalar
Sigil (eg
variables): Expand values as a scalar%(Brace Quote)
:
Initiates or terminates a string (variables expanded)%[]
Array Builder:
Quickly generate arrays%{}
Object
Builder: Quickly generate objects (dictionaries / maps)&&
And Logical
Operator: Continues next operation if previous operation passes'Single Quote'
:
Initiates or terminates a string (variables not expanded)(brace quote)
:
Write a string to the stdout without new line (deprecated)*=
Multiply By
Operator: Multiplies a variable by the right hand value
(expression)*
Multiplication
Operator: Multiplies one numeric value with another
(expression)+=
Add With Operator:
Adds the right hand value to a variable (expression)+
Addition Operator:
Adds two numeric values together (expression)-=
Subtract By
Operator: Subtracts a variable by the right hand value
(expression)->
Arrow Pipe:
Pipes stdout from the left hand command to stdin of the right hand
command-
Subtraction
Operator: Subtracts one numeric value from another (expression)/=
Divide By
Operator: Divides a variable by the right hand value
(expression)/
Division Operator:
Divides one numeric value from another (expression)<~
Assign Or
Merge: Merges the right hand value to a variable on the left hand
side (expression)=>
Generic
Pipe: Pipes a reformatted stdout stream from the left hand command
to stdin of the right hand command=
(arithmetic evaluation):
Evaluate a mathematical function (deprecated)>>
Append
File: Writes stdin to disk - appending contents if file already
exists?:
Elvis Operator:
Returns the right operand if the left operand is falsy (expression)??
Null Coalescing
Operator: Returns the right operand if the left operand is empty /
undefined (expression)?
stderr Pipe: Pipes
stderr from the left hand command to stdin of the right hand command
(DEPRECATED)@Array
Sigil: Expand
values as an array[{ Lambda }]
: Iterate
through structured data{ Curly Brace }
:
Initiates or terminates a code block|
POSIX Pipe: Pipes
stdout from the left hand command to stdin of the right hand
command||
Or Logical
Operator: Continues next operation only if previous operation
fails~
Home Sigil: Home
directory path variablekey-code
): Returns character sequences for any key
pressed (ie sent from the terminal)addheading
): Adds headings to a tableprefix
): Prefix a string to every item in a listsuffix
): Prefix a string to every item in a listalias
): 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 inputappend
): Add data to the end of an arraybg
): Run processes in the backgroundcpuarch
): Output the hosts CPU architecturecpucount
): Output the number of CPU cores available on
your hostcatch
): Handles the exception code raised by
try
or trypipe
cd
):
Change (working) directorylist.case
): Changes the character case of a string or
all elements in an arraybexists
): Check which builtins existhistory
): Outputs murex’s command historycount
): Count
items in a map, list or array2darray
): Create a 2D JSON array from multiple input
sourcesja
):
A sophisticated yet simply way to build a JSON arraymap
):
Creates a map from two data sourcespipe
): Manage Murex named pipesta
):
A sophisticated yet simple way to build an array of a user defined
data-typetmp
): Create a temporary file and write to itdatetime
): A date and/or time conversion tool (like
printf
but for date and time values)debug
): Debugging informationexport
): Define an environmental variable and set it’s
valueargs
): Command line flag parser for Murex shell
scriptingglobal
): Define a global variable and set it’s
valueopen
” (openagent
): Creates a handler
function for open
method
): Define a methods supported data-typescast
):
Alters the data-type of the previous function without altering its
outputset
):
Define a variable (typically local) and set it’s valueunsafe
): Execute a block of code, always returning a
zero exit numbertype
): Command type (function, builtin, alias,
etc)fid-list
): Lists all running functions within the
current Murex sessiongetfile
): Makes a standard HTTP request and return the
contents as Murex-aware data type for passing along Murex
pipelines.err
):
Print a line to the stderresccli
): Escapes an array so output is valid shell
codeeschtml
): Encode or decodes text for HTMLescurl
): Encode or decodes text for the URLexec
): Runs an executablefexec
): Execute a command or function, bypassing the
usual order of precedence.break
):
Terminate execution of a block within your processes scopereturn
): Exits current function scopeexit
):
Exit murexexpr
):
Expressions: mathematical, string comparisons, logical operatorsfalse
):
Returns a false
valueforeach
): Iterate through an arrayformap
): Iterate through a map or other collection of
datafor
): A more
familiar iteration loop to existing developersfg
): Sends a background process into the
foregroundrunmode
): Alter the scheduler’s behaviour at higher
scoping levelrand
): Random field generatorget-type
): Returns the data-type of a variable or
pipeexitnum
): Output the exit number of the previous
processpt
):
Pipe telemetry. Writes data-types and bytes writtenget
):
Makes a standard HTTP request and returns the result as a JSON
objectg
): Glob
pattern matching for file system objects (eg *.txt
)if
):
Conditional statement to execute different blocks of code depending on
the result of the conditionsource
): Import Murex code from another file or code
blockis-null
): Checks if a variable is null or
undefinedmjoin
): Joins a list or array into a single
stringfid-killall
): Terminate all running Murex functions in
current sessionfid-kill
): Terminate a running Murex functionleft
): Left substring every item in a listf
): Lists or filters file system objects (eg
files)which
): Locate command originlockfile
): Create and manage lock filesand
): Returns true
or false
depending on whether multiple conditions are metor
): Returns true
or false
depending on whether one code-block out of multiple ones supplied is
successful or unsuccessful.while
):
Loop until condition falseman-summary
): Outputs a man page summary of a
commandmatch
): Match an exact value in an arrayevent
): Event driven programming for shell
scriptsmurex-package
): Murex’s package managerversion
): Get Murex versionmurex-docs
): Displays the man pages for Murex
builtinscontinue
): Terminate process of a block within a
caller function!
): Reads
the stdin and exit number from previous process and not’s it’s
conditionnull
): null
function. Similar to /dev/nullopen
):
Open a file with a preferred handleros
):
Output the auto-detected OS nameout
):
Print a string to the stdout with a trailing new line charactertout
): Print a string to the stdout and set it’s
data-typeman-get-flags
): Parses man page files for command line
flagstrypipe
): Checks for non-zero exits of each function
in a pipelinepost
):
HTTP POST request with a JSON-parsable returnprepend
): Add data to the start of an arraystruct-keys
): Outputs all the keys in a structure as a
file pathprivate
): Define a private function blocktime
): Returns the execution run time of a command or
blockfunction
): Define a function blockescape
): Escape or unescape inputread
): read
a line of input from the user
and store as a variabletread
)
(removed 7.x): read
a line of input from the user and
store as a user defined typed variable (deprecated)format
): Reformat one data-type into another
data-typerx
):
Regexp pattern matching for file system objects (eg
.*\\.txt
)regexp
): Regexp tools for arrays / lists of
stringsopen-image
): Renders bitmap image data on your
terminalmtac
):
Reverse the order of an arrayright
): Right substring every item in a listround
): Round a number by a user defined
precisionsignal
): Sends a signal RPCsummary
): Defines a summary help text for a
commandconfig
): Query or define Murex runtime settingsruntime
): Returns runtime information on the internal
state of Murextest
): Murex’s test framework - define tests, run
tests and debug shell scriptsmsort
):
Sorts an array - data type agnosticjsplit
): Splits stdin into a JSON array based on a
regex parametertrypipeerr
): Checks state of each function in a
pipeline and exits block on errortryerr
): Handles errors inside a block of codea
): A
sophisticated yet simple way to stream an array or list (mkarray)switch
): Blocks of cascading conditionalsautocomplete
): Set definitions for tab-completion in
the command linetabulate
): Table transformation toolstrue
): Returns
a true
valuetry
):
Handles non-zero exits inside a block of codedie
: Terminate murex
with an exit number of 1 (deprecated)let
: Evaluate a
mathematical function and assign to variable (deprecated)murex-parser
:
Runs the Murex parser against a block of codeThese 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.
select
): Inlining SQL into shell pipelines!bz2
: Decompress a bz2
filebase64
: Encode or
decode a base64 stringgz
: Compress or
decompress a gzip fileqr
: Creates a QR code
from stdinsleep
: 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)path
: Structured object
for working with file and directory pathspaths
: Structured array
for working with $PATH
style datastr
(string): string
(primitive)toml
: Tom’s Obvious,
Minimal Language (TOML)yaml
: YAML Ain’t Markup
Language (YAML)onCommandCompletion
:
Trigger an event upon a command’s completiononFileSystemChange
:
Add a filesystem watchonKeyPress
:
Custom definable key bindings and macrosonPreview
: Full
screen previews for files and command documentationonPrompt
: Events
triggered by changes in state of the interactive shellonSecondsElapsed
:
Events triggered by time intervalsonSignalReceived
:
Trap OS signals0
, 1
,
2
, 3
and above$.
, Meta Values
(json): State information for iteration blocksARGV
(json): Array
of the command name and parameters within a given scopeCOLUMNS
(int):
Character width of terminalEVENT_RETURN
(json): Return values for eventsHOME
(path): Return
the home directory for the current session userHOSTNAME
(str):
Hostname of the current machineLINES
(int):
Character height of terminalLOGNAME
(str):
Username for the current session (historic)MUREX_ARGV
(json): Array of the command name and parameters passed to the
current shellMUREX_EXE
(path): Absolute path to running shellOLDPWD
(path):
Return the home directory for the current session userPARAMS
(json):
Array of the parameters within a given scopePWDHIST
(json):
History of each change to the sessions working directoryPWD
(path): Current
working directoryRANDOM
(int):
Return a random 32-bit integer (historical)SELF
(json): Meta
information about the running scope.SHELL
(str): Path
of current shellTMPDIR
(path):
Return the temporary directoryUSER
(str): Username
for the current sessionmake
:
make
integrationsman
page integrationsdirenv
Integrations: Directory specific environmental variablesyarn
Integrations: Working with yarn
and
package.json
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 Wed Jan 15 23:07:50 UTC 2025 against commit b4c4296b4c429617fd41527ea0efef33c52c15ef2b64972.
Current version is 6.4.2063 (develop) which has been verified against tests cases.