I actually grep for a line from a file and store that line as a string. When I compare that string with a similar string (which is exactly same as other), I'm not getting the result as both of them being equal.
Please help.
#!/bin/bash
ref="BIP1295I: Integration node 'IB10NODEQ03' is an active multi-instance or High Availability integration node that is running on queue manager 'IB10QMGRQ03'."
message1=$(mqsilist| grep IB10NODEQ03 2>&1)
echo $message1
echo $ref
if [ "$message1" = "$ref" ]; then
echo "equal"
else
echo "not equal"
fi
EXECUTING THE SCRIPT
[mqbrkrs@dclqsa80 /tmp]$ sh script*
BIP1295I: Integration node 'IB10NODEQ03' is an active multi-instance or High Availability integration node that is running on queue manager 'IB10QMGRQ03'.
BIP1295I: Integration node 'IB10NODEQ03' is an active multi-instance or High Availability integration node that is running on queue manager 'IB10QMGRQ03'.
not equal