Sun Java System Application Server Platform Edition 8.1 2005Q2 Update 2 Troubleshooting Guide

Using asadmin set Command May Produce Unexpected Results

Description

Unexpected results are returned when setting variables in a command, such as:

asadmin set name={$a-b}

In this case, name is set to b, not {$a-b} because the shell syntax ${a=b} is interpreted as “if the variable a is unset, substitute the value b, otherwise substitute the value of a.” This is standard shell behavior. For example, consider the following:

asadmin set default-config.http-service.http-listener.http-listener-1.port=
${http-listener-1-port}

In this case, default-config.http-service.http-listener.http-listener-1.port is set to listener-1-port, which is invalid.