Extended Globbing

Much like the order of operations in mathematics, Bash evaluates these shell expansions in a specific order.

  1. Brace Expansion

    • {1..8}

  2. Tilde Expansion

    • ~/

  3. Parameter Expansion

    • $USER , $USERID

  4. Variable Expansion

    • $(who | tail -n10 | awk '{print $2}')

  5. Arithmetic Expansion & Command Substitution (left to right)

    • $(($USERID + 12 ))

  6. Word Splitting

  7. Filename Expansion

    • .*

  8. Quote Removal

    • "$USER"

ENABLING EXTENDED GLOBBING

shopt -s extglob

LEARNNN

Last updated