Regular expressions (Bash): verschil tussen versies
Naar navigatie springen
Naar zoeken springen
Regel 3: | Regel 3: | ||
<pre> | <pre> | ||
if [[ "$switches" =~ [f] ]]; then | if [[ "$switches" =~ [f] ]]; then | ||
− | + | echo "f - Create folder structure" | |
− | + | mappenstructuur=true | |
fi | fi | ||
</pre> | </pre> |
Versie van 29 sep 2022 12:45
To use regular expressions in Bash comparisons, use operator =~
, like
if [[ "$switches" =~ [f] ]]; then echo "f - Create folder structure" mappenstructuur=true fi
I have the impression that regular expressions (regex) in Bash may not be the same as in MySQL, hence some more details in this article.