Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Passing multiple lines of code to wsadmin.sh?

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.

like image 713
ArtOfWarfare Avatar asked Sep 03 '25 03:09

ArtOfWarfare


1 Answers

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

like image 157
Ram Vennam Avatar answered Sep 07 '25 17:09

Ram Vennam