alias
Create an alias for a command
alias
defines an alias for global usage
alias: alias=command parameter parameter
!alias: command
Because aliases are parsed into an array of parameters, you cannot put the entire alias within quotes. For example:
# bad :(
» alias hw="out Hello, World!"
» hw
exec: "out\\ Hello,\\ World!": executable file not found in $PATH
# good :)
» alias hw=out "Hello, World!"
» hw
Hello, World!
Notice how only the command out "Hello, World!"
is quoted in alias
the same way you would have done if you'd run that command "naked" in the command line? This is how alias
expects it's parameters and where alias
on murex differs from alias
in POSIX shells.
In some ways this makes alias
a little less flexible than it might otherwise be. However the design of this is to keep alias
focused on it's core objective. For any more advanced requirements you can use a function
instead.
Alias names can only include alpha-numeric characters, hyphen and underscore. The following regex is used to validate the alias
's parameters: ^([-_a-zA-Z0-9]+)=(.*?)$
Like all other definable states in murex, you can delete an alias with the bang prefix:
» alias hw=out "Hello, World!"
» hw
Hello, World!
» !alias hw
» hw
exec: "hw": executable file not found in $PATH
There is an order of precedence for which commands are looked up:
test
and pipe
functions because they alter the behavior of the compileralias
. All aliases are globalfunction
. All functions are globalprivate
. Private's cannot be global and are scoped only to the module or source that defined them. For example, You cannot call a private function from the interactive command lineset
or let
@g
alias
!alias
exec
: Runs an executableexport
: Define an environmental variable and set it's valuefexec
: Execute a command or function, bypassing the usual order of precedence.function
: Define a function blockg
: Glob pattern matching for file system objects (eg *.txt)global
: Define a global variable and set it's valuelet
: Evaluate a mathematical function and assign to variablemethod
: Define a methods supported data-typesprivate
: Define a private function blockset
: Define a local variable and set it's valuesource
: Import murex code from another file of code blockThis 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 May 26 22:49:43 UTC 2022 against commit 59e27bb59e27bb1013043fc4a940cf9a2767c63f31dad2c.
Current version is 2.8.2100 which has been verified against 15889 tests cases.