Using a wildcard in a condition to match reading of a file

Solution 1:

To interpret the right hand side of == inside of [[ ... ]], don't quote it.

if [[ "${object}" == ${LineExc} ]]; then

In fact, you don't have to quote the left hand side, either, but it doesn't change the behaviour.