CLI scripts: flow control and commands vs operations

Latest response

We are trying to write some CLI scripts that can be used on both standalone development servers and domain-managed production servers.
'if' flow control statements are not working how I would expect them to.

E.g., running this file on a standalone server:

if (result == DOMAIN) of /:read-attribute(name=launch-type)
    cd /profile=my_profile
end-if

results in:

JBAS014808: Child resource '"profile" => "my_profile"' not found
Press any key to continue . . .

I would not expect the 'cd' line to be evaluated. Is this a bug, or a misunderstanding of how the flow control statements work?
Tried in both EAP 6.2 and EAP 6.3-beta with the same result.

Responses