Quantcast
Channel: bash [[ = ]] behaviour - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 2

Answer by don_crissti for bash [[ = ]] behaviour

$
0
0

= is the same as == when inside [[...]]. As per the more recent man page, under SHELL GRAMMAR > Compound Commands > [[ expression ]]:

The = operator is equivalent to ==

and further down, under CONDITIONAL EXPRESSIONS:

string1 == string2
string1 = string2
        True  if  the  strings  are equal.  = should be used with the test command
        for POSIX conformance. When used with the [[ command, this performs pattern
        matching as described above (Compound Commands).

bash info page:

enter image description here


Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>