I am trying to pass a value retrieved from WebSphere using a Jython script called by wsadmin.sh to a variable in my caller shell script.
The caller shell script (getValue.sh) would have:
#!/bin/sh
/opt/ibm/WebSphere/AppServerV70/bin/wsadmin.sh -lang jython -conntype SOAP -f /home/user/Jython.py
exit 0
The Jython script (Jython.py) would have:
cellName = AdminControl.getCell()
return cellName
How can I store the value of cellName into a variable in my shell script, for example, CELL_NAME, that I could use like:
echo "Cell Name is: " ${CELL_NAME}
This version of the Jython script is a lot simpler than the one I am using in reality, but I think the concept is the same.
If I am using a lot of functions in the Jython script, is there a way to pass one of the values to my shell script? i.e.
def getValue1():
value1 = "1"
return value1
def getValue2():
value2 = "2"
return value2
def getValue3():
value3 = "3"
return value3
print getValue1()
print getValue2()
print getValue3()
I there a way to store multiple values into different shell script variables? i.e.
echo "Value #1: " ${VALUE_ONE}
echo "Value #2: " ${VALUE_TWO}
echo "Value #3: " ${VALUE_THREE}
... This way I could run one Jython script that would retrieve multiple values and use those multiple values in my shell script for further processing.
Thank you for any help you can provide.