Jacl script escape '{' to be used inside of a string?

I am looking to use the string ${USER_HOME_DIR} inside a jacl script. I know to escape the $ for processing however jacl still doesn't like my curly brackets since it thinks it is a code block or something. Anyone have insight?

The result will modify a websphere environment variable, I understand this can probably be done in jython but I am restricted to jacl.
set nodeName [$AdminControl getNode]
  append node "Node=" $nodeName
  set driverpath "\${USER_INSTALL_ROOT}/serverClasspath"
  set varName "MY_VARIABLE"
  append varAttrs "-scope " $node " -variableName " $varName " -variableValue " $driverpath
  $AdminTask setVariable $varAttrs

Open in new window

LVL 1
techieBrandonAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

techieBrandonAuthor Commented:
I am special...

http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/topic/com.ibm.websphere.express.doc/info/exp/ae/ccws_variable.html

The value of a configuration attribute can contain references to one or more variables. The syntax for such an attribute is the name of the variable, enclosed in either a pair of curly braces { } or a pair of parenthesis ( ). In either case, the variable is proceeded by the dollar sign.
0
HonorGodSoftware EngineerCommented:
Escape the open curly brace in the same way...

\{

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
techieBrandonAuthor Commented:
 set nodeName [$AdminControl getNode]
  append node "Node=" $nodeName
  set driverpath "\$(USER_INSTALL_ROOT)/serverClasspath"
  set varName "MY_VARIABLE"
  append varAttrs "-scope " $node " -variableName " $varName " -variableValue " $driverpath
  $AdminTask setVariable $varAttrs
0
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

techieBrandonAuthor Commented:
HonorGod,

I had attempted that, no joy
0
HonorGodSoftware EngineerCommented:
I'm sorry.  I don't understand your update.

Can you use the backslash to allow the open curly brace, or open parenthesis to be in your string?
0
HonorGodSoftware EngineerCommented:
What do you expect the value to be?


wsadmin>set driverpath "\$(USER_INSTALL_ROOT)/serverClasspath"
$(USER_INSTALL_ROOT)/serverClasspath
wsadmin>puts $driverpath
$(USER_INSTALL_ROOT)/serverClasspath
 
wsadmin>

Open in new window

0
techieBrandonAuthor Commented:
I expect the value to be $(USER_INSTALL_ROOT), however that is fine since WAS will accept that in place of ${USER_INSTALL_ROOT}. However I am still curious why \$\{USER_INSTALL_ROOT\} was not acceptable. However it might have more to do with wsadmin and less to do with jacls interpretation of it.
0
HonorGodSoftware EngineerCommented:
Well, as you can see in http://#a24453077 I used an interactive wsadmin (Jacl) session to show the assignment of the value to "driverpath", and its actual value.

So, is it doing what you expect, or not?

If not, how can I help?
0
techieBrandonAuthor Commented:
This is correct, however not the solution in regards to use with wsadmin. The solution for using websphere environment variables (generally seen as ${VARIABLE}) it to pass it as $(VARIABLE). Using parenthesis instead of the brackets is acceptable by wsadmin and is still evaluated as the websphere environment variable.
0
HonorGodSoftware EngineerCommented:
Thanks for the grade & points.

I'm glad to have been able to help in some way.

Good luck & have a great day.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java App Servers

From novice to tech pro — start learning today.