I want to call a function ONLY when the file name ends with .request
but somehow it calls the function if request
is sub-string.
I marked with red and green the imported parts, on the right it's the output
for file in ${filesOrDir[*]}; do
if [[ -f "$file" ]]; then
if [[ "$file"=*[".request"] ]]; then
# Enters here when .request is a substring.
fi
fi
if [[ -d "$file" ]]; then
# ... some logics
fi
done