Bash / Basic: syntax, values, and control

Bash β€” Basic: syntax, values, and control

Build exact models for expansion, quoting, parameters, statuses, functions, and arrays.

6 lessons Β· No account required

What you will learn

  • Predict argument count and preserve data values.
  • Write clear functions and control flow with documented contracts.
  1. Read Bash as a command language

    Follow lexical words, shell grammar, expansion, redirection, command lookup, and status instead of treating a line as an opaque string.

    Start learning
  2. Preserve argument boundaries through quoting

    Predict word splitting and filename expansion, then use literal arguments and Bash arrays instead of strings that merely resemble commands.

    Start learning
  3. Design parameter and string contracts

    Use positional parameters, defaults, substring operations, and explicit value validation while preserving unset and empty distinctions.

    Start learning
  4. Make status and control flow explicit

    Use command results, conditions, case selection, and loops without assuming printed output or set -e defines success.

    Start learning
  5. Build functions with clear state boundaries

    Define argument, output, status, and state contracts for small reusable Bash functions without confusing sourcing with child execution.

    Start learning
  6. Represent lists and keyed data with arrays

    Use indexed and associative Bash arrays to preserve values, distinguish keys from positions, and avoid undocumented iteration assumptions.

    Start learning
Back to course