This is a trick to compare variables and prevent a weird behaviour if some of them are not defined / are empty.
You can use ,
or any other. The main thing is that it wants to compare ${LIBS_FROM_GIT}
with ${name}
and prevent the case when one of them is empty.
As indicated by Etan Reisner in comments, [[
doesn't have empty variable expansion problems. So this trick is usually used when comparing with a single [
:
This doesn't work:
$ [ $d == $f ] && echo "yes"
bash: [: a: unary operator expected
But it does if we add a string around both variables:
$ [ ,$d, == ,$f, ] && echo "yes"
$
Finally, note you can use directly this:
[[ ,${LIBS_FROM_GIT}, =~ ,${name}, ]] && return 0 || return 1