In BASH how can I tell if the string contains another string, ignoring upper or lower case.
Example:
if [[ $FILE == *.txt* ]]
then
let FOO=1;
fi
I would like this statement to be true no matter if the value of $FILE is upper, lower or mixed.
One way is to covert
FILE
tolower-case
before you test usingtr
:Example:
output: