bash [[ [a] == [a] ]] not true? square bracket affect compare result : <p>Anyone know why this happens? Is this a bug of bash?</p>

<pre><code>x='mnt:[4026532411]'

[[ $x == $x ]] &amp;&amp; echo OK
</code></pre>

<p>I am expecting result <code>OK</code>, but it did not.</p>

<p>Of course, this works</p>

<pre><code>[[ "$x" == "$x" ]] &amp;&amp; echo OK
</code></pre>

<p>But as I know, bash [[ ]] have a merit that no need to quote var when compare.</p>

<pre><code>x='a b'
[[ $x == $x ]] &amp;&amp; echo OK
</code></pre>

<p>works.</p>

<p>Ironical things is</p>

<pre><code>x='mnt:[4026532411]'

[[ $x != $x ]] &amp;&amp; echo Oh my god
</code></pre>

<p>result is Oh my god</p>
