v5.0
v5.0
v5.0 is a massive release. It brings along changes to syntax, new operators as well as new builtins, reserved variables and a new event
Breaking Changes
Murex tries to retain backwards compatibility wherever possible. However sometimes changes need to be made to keep the language, shell and general usability moving forwards. The following are a list of such changes:
- unquoted parameters that are formatted like
[alpha, numeric, underscore]\(...\)will be parsed as a function rather than a string. egcommand foo(bar baz)where foo will be treated as a subshell function with bar baz as its parameters. Solution is simply to put that parameter inside quotation marks instead of leaving it as a bareword parameter - brace quotes without a leading
%will be first parsed as an expression. eg%(valid string)vs(valid expression)which might cause unexpected results in edge cases where a(string)is also a valid expression. Please update(strings)to include%, eg%(string)
Deprecation Warnings
These are changes to Murex defaults, however you shouldn't expect any breaking changes to Murex's behaviour:
$ARGVnow preferred instead of$ARGS($ARGSwill remain supported for now)command: parameters ...style syntax has been deprecated in favour of the more traditionalcommand parameters ...(without a colon) syntax.
Features
Features marked as EXPERIMENTAL are provided without assurances of future breaking changes.
new website!!
commands can now be inlined in expressions, eg
foobar = uptime()(issue 676)commands can also be inlined into statements too, eg
echo uptime()(issue 676)new event
onSignalReceivedfor catching OS signalsnew builtin
signalfor sending OS signalsnew builtins
which(issue 609)new builtin
type(issue 609)cddefaults to~if now parameters are passed (issue 672)cd -changes to previous directory (issue 672)$SELF.Interactivevalue to detect if scope is running in an interactive shell (issue 685)$COLUMNSreserved variable to output width of terminal$MUREX_ARGVreserved variable to output command line parameters of Murex shell (not to be confused with the parameters of the running function, eg$ARGV)formatfrom a table (egcsv) tojsonoryamlwill now return a map instead of an array of arrays (usejsonl(jsonlines) if you need to retain a 2D array of data in JSON-like format)csvdata type andselectbuiltin now support converting maps (eg JSON objects) into tables (issue 689)murex-doc/helpcan now display a greater number of documents when offlineimproved man page parsing
improved man page displays in preview
aliasnow storesFileRefmetadata (issue 124)packages can now be removed via
murex-package remove(issue 687)a package creation wizard has been added via
murex-package newanother new flag for
murex-package: git. Which allows you to rungitcommands on a package even when you're not in that package's working directoryversion constraints added to Murex packages (docs to follow)
readline:
upanddownarrows on a partial command line will cycle through history of only lines that contain your partial command linereadline: new hotkey,
ctrl+zwhile readline is open will undo the previous key strokesEXPERIMENTAL: logical operators added to expressions:
||and&&(issue 708)EXPERIMENTAL: new assignment operator
:=, assigns a value but retains the former data type, thus converting the value when required (ideally I'd have preferred this as default option but it ran the risk of some serious and unexpected breaking changes to the behaviour of some existing shell scripts)EXPERIMENTAL: Various builtins that require variable names now support
$sigils, egforeach $var { ... }works as well asforeach var { ... }EXPERIMENTAL: new variable group
$MOD, like$GLOBALbut scoped to the module levelEXPERIMENTAL: new command pipe to create variable based on that command's FID and PID:
<fid:VAR_NAME>and<pid:VAR_NAME>respectivelyEXPERIMENTAL: official support added for a pure Go library for sqlite3 -- thus saving individuals from having to install
gccas well asgocompilers. The reducedcgofootprint has already reduced file sizes by a 3rd
Bug Fixes
- homebrew environment set on Intel macOS systems (previous only worked on ARM)
configfunctions (eghint-text-func) now execute with theFileRefof the setter. Meaning they can call privates correctly- scalars fail expression pre-parser (issue 674)
- readline: prompt can now span multiple lines (issue 612)
- floating point numbers were not loosely compared correctly in expressions
- readline: delay timer hint text should disappear when completed
$PWDHISTwas corrupting upon first update- fixed bug with
git-commitman page parsing, which caused the parser to hang and ramp up CPU usage ongitautocompletions - fixed parsing of nested quotes inside curly braces (issue 697)
- don't carry non-zero exit numbers forward if unit test successful
- fixed instances where
FileRefeither wasn't being set, wasn't being set correctly, or was missing a timestamp (issue 696) printfdependency removed fromaliasesfunction -- this meansaliasesnow works on Windows too- removed lazy variable expansion from hint text (issue 663)
||and&&now parse correctly in expressions
Special Thanks
Special thank yous for this release goes to the following contributors:
- orefalo for building the new website (which is now small task!), documentation fixes, and general support
- tiymat for the high quality bug reports and beta testing
- All the downstream package maintainers, who publish Murex to their preferred operating systems/package managers thus making it easier for a wider audience to install and update Murex
You rock!
Published: 07.09.2023 at 00:12
See Also
- Alias "shortcut":
alias: Create an alias for a command - FileRef: How to track what code was loaded and from where
- Location / Type Of Command:
which: Locate command origin - Modules And Packages: Modules and packages: An Introduction
- Murex Event Subsystem:
event: Event driven programming for shell scripts - Murex Package Manager:
murex-package: Murex's package manager - Murex's Offline Documentation:
murex-docs: Displays the man pages for Murex builtins - Send Signal IPC:
signal: Sends a signal RPC - Shell Configuration And Settings:
config: Query or define Murex runtime settings - Tab Autocompletion:
autocomplete: Set definitions for tab-completion in the command line ARGV(json): Array of the command name and parameters within a given scopeCOLUMNS(int): Character width of terminalMUREX_ARGV(json): Array of the command name and parameters passed to the current shellSELF(json): Meta information about the running scope.csv: CSV files (and other character delimited tables)float(floating point number): Floating point number (primitive)onSignalReceived: Trap OS signals
This document was generated from gen/changelog/v5.0_doc.yaml.