TIL: Bash substring check
2022-08-29
- bash
There’s a simple, but non obvious, trick to check for substrings in bash:
if [[ "sally" == *"sal"* ]]; then
printf "sal is in sally!"
fi
There’s a simple, but non obvious, trick to check for substrings in bash:
if [[ "sally" == *"sal"* ]]; then
printf "sal is in sally!"
fi