“[ ]” vs. “[[ ]]” in Bash shell

test‘s string equality operator doesn’t do globs.

$ [ abc = *bc ] ; echo $?
1
$ [[ abc = *bc ]] ; echo $?
0

Leave a Comment