Variable Substitution in WSAdmin: Variables in braces are treated as constants

Just a quick FYI to those of you who are doomed to write WSAdmin scripts, if you use variable names and enclose them in curly braces ‘{‘, then commands will treat it as a constant string and your variables will not resolve to their values.

$AdminTask blah {-file $VariableFileName}

Will cause and error that the physical file “$VariableFileName” could not be found.

To resolve the issue use the subst or list command:

$AdminTask blah [subst {-file $VariableFileName}]

http://www-01.ibm.com/support/docview.wss?uid=swg21254555

Related Posts


You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

AddThis Social Bookmark Button

One Response to “Variable Substitution in WSAdmin: Variables in braces are treated as constants”

  1. Dan, this is one reason I tend to write my wsadmin scripts in jython rather than Jacl… the syntax is less irritating. Jacl will also eventually be phased out, so it’s worth getting used to jython.

Leave a Reply