murex Shell Docs

Command Reference: alter

Change a value within a structured data-type and pass that change along the pipeline without altering the original source input

Description

alter a value within a structured data-type.

The path separater is defined by the first character in the path. For example /path/to/key, ,path,to,key, |path|to|key and #path#to#key are all valid however you should remember to quote or escape any special characters (tokens) used by the shell (such as pipe, |, and hash, #).

Usage

<stdin> -> alter: /path value -> <stdout>

Examples

» config: -> [ shell ] -> [ prompt ] -> alter: /Value moo
{
    "Data-Type": "block",
    "Default": "{ out 'murex » ' }",
    "Description": "Interactive shell prompt.",
    "Value": "moo"
}

alter also accepts JSON as a parameter for adding structured data:

config: -> [ shell ] -> [ prompt ] -> alter: /Example { "Foo": "Bar" }
{
    "Data-Type": "block",
    "Default": "{ out 'murex » ' }",
    "Description": "Interactive shell prompt.",
    "Example": {
        "Foo": "Bar"
    },
    "Value": "{ out 'murex » ' }"
}

However it is also data type aware so if they key you're updating holds a string (for example) then the JSON data a will be stored as a string:

» config: -> [ shell ] -> [ prompt ] -> alter: /Value { "Foo": "Bar" }
{
    "Data-Type": "block",
    "Default": "{ out 'murex » ' }",
    "Description": "Interactive shell prompt.",
    "Value": "{ \"Foo\": \"Bar\" }"
}

Numbers will also follow the same transparent conversion treatment:

» tout: json { "one": 1, "two": 2 } -> alter: /two "3"
{
    "one": 1,
    "two": 3
}

Please note: alter is not changing the value held inside config but instead took the STDOUT from config, altered a value and then passed that new complete structure through it's STDOUT.

If you require modifying a structure inside murex config (such as http headers) then you can use config alter. Read the config docs for reference.

Detail

Path

The path parameter can take any character as node separators. The separator is assigned via the first character in the path. For example

config -> alter: .shell.prompt.Value moo
config -> alter: >shell>prompt>Value moo

Just make sure you quote or escape any characters used as shell tokens. eg

config -> alter: '#shell#prompt#Value' moo
config -> alter: ' shell prompt Value' moo

Supported data-types

You can check what data-types are available via the runtime command:

runtime --marshallers

Marshallers are enabled at compile time from the builtins/data-types directory.

See Also

This site is rebuilt weekly, the content is automatically generated from murex's source code. Last built on Mon May 25 06:11:51 UTC 2020 against commit aa3f3b7aa3f3b7e471543754fdcaf910d4920cad9112b91. Downloadable murex binaries are also built weekly. Current version is 0.48.0120 BETA which has been verified against 29375 tests.