2 Matching Annotations
  1. Mar 2024
    1. The function body can be any compound command, not just a group command ( {} ). Use a sub-shell: is_hello_world() ( shopt -s nocasematch [[ "$1" =~ "hello world" ]] )
    2. foo () {...} just looks so natural, you never think that the braces aren't part of the function syntax, rather than the mostly commonly used compound command.