How to parse a command output in bash -


i executing command on bash gives me following output

bash-4.2$ soapcli.sh maxadmin "my_passw0rd" "http://localhost:8777/ws/pid/tpmlitesoapservice?wsdl" executedeploymentrequest testcleanup "numeber=1234" result: 990823 

how store result i.e. 990823 in variable. stored entire output in 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 

add awk command through pipe | awk {print $2} command:

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


Comments

Popular posts from this blog

sql - Time in datatime field -

javascript - How to split the success output from an Ajax post? -

java - sharing object across different classes -