Sometimes it is needed to have access to the location where applications are installed when creating wsadmin scripts. The following wsadmin script (jacl) will resolve the Environmental Variable "APP_INSTALL_ROOT" and print out the path where applications are installed.
JACL script for IBM WebSphere WSAdmin
# Search for the node of the first app servers in the app server list
set cellName ""
set nodeName ""
foreach c {
foreach n {
foreach s {
set sName
set appServ 0]
if { > 0 && $sName == } {
set nodeName
set cellName
}
}
}
}
puts "Using Cell $cellName"
puts "Using Node $nodeName"
### Retrieve the value of the variable. Assuming node scope.
proc getNodeScopeVariable { varName } {
global AdminConfig
global nodeName
set node
set varSubstitutions
foreach varSubst $varSubstitutions {
set getVarName
if { == 0} {
set res
return $res
}
}
}
### Recursively resolve the variable.
proc resolve { str } {
set i
set j
# Check if there is an opening bracket for a variable.
if {$i != -1} {
set subVar ]
set subVarValue
set str $j $subVarValue]
# Continue resolving variables if there are more
if { != -1} {
set str
}
}
return $str
}
set var APP_INSTALL_ROOT
set res ]
puts "$var: $res"
Third Party Software Installation
WARNING:
The third-party product(s) discussed in this technical note is manufactured by vendors independent of Strategy. Strategy makes no warranty, express, implied or otherwise, regarding this product, including its performance or reliability.