murex Shell Docs

Parser Reference: Array (@) Token

Expand values as an array

Description

The array token is used to tell murex to expand the string as multiple parameters (an array) rather than as a single parameter string.

Examples

» set: example="foo\nbar"

» out: $example
foo
bar

» out: @example
foo bar

In this example the second command is passing foo\nbar (\n escaped as a new line) to out. The third command is passing an array of two values: foo and bar.

The string and array tokens also works for subshells

» out: ${ ja: [Mon..Fri] }
["Mon","Tue","Wed","Thu","Fri"]

» out: @{ ja: [Mon..Fri] }
Mon Tue Wed Thu Fri

Detail

Since arrays are expanded over multiple parameters, you cannot expand an array inside quoted strings like you can with a string variable:

» out: "foo ${ ja: [1..5] } bar"
foo ["1","2","3","4","5"] bar

» out: "foo @{ ja: [1..5] } bar"
foo  1 2 3 4 5  bar

» (${ ja: [1..5] })
["1","2","3","4","5"]   

» (@{ ja: [1..5] })
@{ ja: [1..5] } 

See Also

This 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 12 10:38:51 UTC 2022 against commit 50d6f4550d6f45b79e200b3cbc8e8e2639854a5265c7021.

Current version is 2.4.3010 BETA which has been verified against tests.