0

Can someone suggest how to compare two urls in bash. I am getting false for below values.

var1=https://sample.myweb.net/templateuri/abc?resource
var2=https://sample.myweb.net/templateuri/abc?resource

Getting true for below condition.

if [[ "$var1" != "$var2" ]]; then
  echo 'var1 and var2 not same'
fi

Can you please help to how go inside condition if not same only.

Cyrus
  • 84,225
  • 14
  • 89
  • 153

1 Answers1

0

Below code is working as assignment with quotes.

actVal="$var1"  expVal="$var2"   if [[ "$actVal" != "$expVal" ]]; then
Benjamin W.
  • 46,058
  • 19
  • 106
  • 116