TIL: Bash substring check

2022-08-29

There’s a simple, but non obvious, trick to check for substrings in bash:

if [[ "sally" == *"sal"* ]]; then
  printf "sal is in sally!"
fi