I can not plunge into this problem and I hope for your help.
In a bash script, I use the curl command, which should receive data from the server. The curl response is put into the bash variable because I want to check the answer.
The answer is as follows:
<?xml version="1.0" encoding="UTF-8"?> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"> <env:Body><dp:response xmlns:dp="http://www.datapower.com/schemas/management"> <dp:timestamp>2018-02-28T13:31:36+01:00</dp:timestamp> <dp:result> OK </dp:result> </dp:response> </env:Body> </env:Envelope>
An important part:
<dp:result> OK </dp:result>
How can I check in my bash script whether this exact string is in a variable (or not)? I tried several approaches with different types of screens, but so far I have not been able to make them insignificant (always ending with a problem with one of the special characters).
Thank you for your help!
variables bash shell curl
scheuri
source share