String comparison doesn't work

Viewed 1959

For some reason this script prints "string are equal"

#!/bin/bash
A='foo'
B='bar'

if [ $A=$B ];
then
  echo 'strings are equal' 
fi

What am I doing wrong?

2 Answers
Related