0

I am executing a command on bash which gives me the following output

bash-4.2$ soapcli.sh maxadmin "my_passw0rd" "http://localhost:8777/ws/pid/TpmLiteSoapService?wsdl" executeDeploymentRequest testCleanup "numeber=1234"
Result: 990823

How to store the Result i.e. is 990823 in a variable. I stored the entire output in a variable using:

res=`soapcli.sh maxadmin "my_password" "http://localhost:8777/ws/pid/TpmLiteSoapService?wsdl" executeDeploymentRequest testCleanup "number=1234" 2>&1

echo $res
Result: 1234

1 Answer 1

1

Add awk command through the pipe | awk {print $2} into your command:

bash-4.2$ soapcli.sh maxadmin "my_passw0rd" "http://localhost:8777/ws/pid/TpmLiteSoapService?wsdl" executeDeploymentRequest testCleanup "numeber=1234" | awk '{print $2}'

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.