I would like to pass a few lines of code to a WebSphere profile.
Here's what I attempted:
# ./wsadmin.sh -lang jython -c 'print("Hello")
> print("World!")'
This printed out a response of:
WAS7209I: Connected to process"<my profile name>" on node <node name> using SOAP connector; The type of process is: UnManagedProcess
Hello
Note that it seems to just ignore the same line of code.
When I try the same thing in Python, it works fine:
# python -c 'print("Hello")
> print("World!")
Prints:
Hello
World!
I'm using WebSphere version 8.5 on CentOS 7.
Note: After getting Ram Vennam's answer, I posted a related question with a different slant on Super User: https://superuser.com/q/939746/240375 - this is where I really ended up getting my answer.
You can use a semicolon:
./wsadmin.sh -lang jython -c 'print("Hello");print("World!")'
or, a script file can be given as input using –f option along with wsadmin.
$ wsadmin.sh –f your_script_file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With