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.
"Double Quote"
: Initiates or terminates a string (variables expanded)$Variable
Sigil: 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[ ..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[{ Lambda }]
: Iterate through structured data{ Curly Brace }
: Initiates or terminates a code block|>
Truncate File: Writes stdin to disk - overwriting contents if file already exists|
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 variable!
(not): Reads the stdin and exit number from previous process and not’s it’s condition2darray
: Create a 2D JSON array from multiple input sources<pipe>
Read Named Pipe: Reads from a Murex named pipe<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
: 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 its 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 conditionis-null
: Checks if a variable is null or undefinedja
(mkarray): A sophisticated yet simply way to build a JSON arrayjsplit
: Splits stdin into a JSON array based on a regex parameterkey-code
: Returns character sequences for any key pressed (ie sent from the terminal)left
: 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 for open
or
: 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 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 a true
valuetry
: Handles non-zero exits inside a block of codetryerr
: Handles errors inside a block of codetrypipe
: Checks for non-zero exits of each function in a pipelinetrypipeerr
: Checks state of each function in a pipeline and exits block on errortype
: Command type (function, builtin, alias, etc)unsafe
: Execute a block of code, always returning a zero exit numberversion
: Get Murex versionwhich
: Locate command originwhile
: 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)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 signalsmake
: 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 Thu Aug 15 14:38:34 UTC 2024 against commit 50ed9d650ed9d6df391240d3c2c02e623636e508dfcdad1.
Current version is 6.2.4000 which has been verified against tests cases.