v3.0
v3.0
This is a major release that brings a significant number of changes and improvements, including a complete overhaul of the parser. Backwards compatibility is a high priority however these new features bring greater readability and consistency to shell scripting. So while the older syntax remains for compatibility, it is worth migrating over to the newer syntax for all new code being written
Breaking Changes
Optional builtin removed:
bson
. This was disabled by default and likely never used. So it has been removed to reduce Murex's testing footprint. It can easily be re-added if anyone does actually use itOptional builtin removed:
coreutils
. This was actually enabled by default for Windows builds. However rewriting Linux/UNIX coreutils for Windows support is a massive project in its own right and with the maturity of WSL there's almost no reason to run Murex on "native Windows". So thecoreutils
builtin has been dropped to allow us to focus on the responsibilities of the shell
Features
Support for expressions, eg
5 * 5
orfoobar = $foo + "bar"
, etc. This syntax can be used directly or specified specifically via theexpr
builtinNew syntax sugar for creating JSON objects:
%{ foo: bar }
New syntax sugar for creating JSON arrays:
%[ foo bar ]
New syntax sugar for creating strings:
%()
(this is preferred over the, now deprecated, feature of parenthesis quotes)Ranges supported in
[]
(@[
is now deprecated)Support for multiline comments:
/# comment #/
. It is unfortunate this differs from C-style comments (/* comment */
) but this has to be the case because/*
is ambiguous for barewords in shells: is it a path and glob or a comment? Where as/#
isn't a common term due to#
denoting a commentIf any processes pass
null
as a data type across the pipe, it will be ignored. This solves the problem where functions that don't write to stdout would still define the data typeConfig option auto-glob renamed to expand-glob, and now enabled by default
Globbing exclusion list. This allows you to avoid annoying prompts when parameters shouldn't be expanded as globs by the shell (eg when using regular expressions). This can be managed via shell expand-glob-unsafe-commands option in
config
@g
removed. It is no longer needed with expand-glob enabled by defaultNew builtin:
continue
: skip subsequent processes in an iteration block and continue to next iterationNew builtin:
break
: exit out of a block of code (eg in an iteration loop)Additional syntax for index (
[
):*1
: 1st row,*A
: 1st columnNew alias:
help
->murex-docs
. This brings Murex a little more inline with Bash et alpre-cache-hint-summaries now enabled by default after testing has demonstrated it doesn't have nearly as expensive footprint as first assumed
Hitting TAB when nothing has been typed in the REPL will suggest past command lines
^
autocompletion addedgetfile
writes to disk if stdout is a TTYmkarray (eg
ja
) now writes an integer array if range is integers. egja: [1..3]
. This change wouldn't affecta
since that outputs as list of strings (for streaming performance reasons) rather than a data type aware documentdebug
(method) output tweakedImproved error messages in a number places
Revamped README / website landing page
Non-User Facing / Maintenance Changes
Minimum Go version supported is now 1.17.x
Main parser completely rewritten
ReadArray
API now requires acontext.Context
egrep
references changed togrep -E
to work around GNU grep deprecating support for egrepAdded marshallers for
boolean
,null
Variables.GetValue()
now errors instead of returnsnil
when no variable setAdditional tests. So many new tests added
Lots of code refactoring
Bug Fixes
regexp
wasn't erroring if nothing was matchedreadline: fixed deadlock
append
andprepend
now type aware (no longer converts all arrays into string arrays)foreach
was setting variables as strings rather than honoring their original data typeyarn
autocompletion errors should be suppressedspellcheck missing
break
causing more occasionally incorrect instances of underlined wordsconfig
wasn't passing data type when executing blocks via evaldebug
wasn't setting data type when used as a functionmacro variables don't re-prompt when the same variable is used multiple times
Published: 31.12.2022 at 08:10
See Also
- Append To List (
append
): Add data to the end of an array - Create JSON Array (
ja
): A sophisticated yet simply way to build a JSON array - Download File (
getfile
): Makes a standard HTTP request and return the contents as Murex-aware data type for passing along Murex pipelines. - Exit Block (
break
): Terminate execution of a block within your processes scope - Expressions (
expr
): Expressions: mathematical, string comparisons, logical operators - Filter By Range
[ ..Range ]
: Outputs a ranged subset of data from stdin - For Each In List (
foreach
): Iterate through an array - Murex's Offline Documentation (
murex-docs
): Displays the man pages for Murex builtins - Next Iteration (
continue
): Terminate process of a block within a caller function - Prepend To List (
prepend
): Add data to the start of an array - Regex Operations (
regexp
): Regexp tools for arrays / lists of strings - Shell Configuration And Settings (
config
): Query or define Murex runtime settings - Stream New List (
a
): A sophisticated yet simple way to stream an array or list (mkarray) - index: Outputs an element from an array, map or table
This document was generated from gen/changelog/v3.0_doc.yaml.