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.
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.
Copyright © 2021 Jogjafile Inc.
One way is to covert
FILEtolower-casebefore you test usingtr:Example:
output: