# Shell Language Prompt Snippet ## Key Concepts - **Shebang Line**: `#!/bin/bash` or `#!/usr/bin/env bash` specifying the interpreter - **Variables**: `VAR=value` assignment, `$VAR` or `${VAR}` expansion, no spaces around `=` - **Functions**: `function name()` or `name()` for reusable command groups - **Conditionals**: `if [[ condition ]]; then ... fi` with `[[ ]]` for extended tests - **Loops**: `for item in list`, `while condition`, `until condition` iteration patterns - **Pipes and Redirection**: `|` for chaining commands, `>` / `>>` / `2>&1` for output redirection - **Exit Codes**: `$?` captures last command status; `set -e` exits on any failure - **Strict Mode**: `set -euo pipefail` for robust error handling (exit on error, undefined vars, pipe failures) - **Command Substitution**: `$(command)` captures command output as a string - **Here Documents**: `< "Build automation script compiling TypeScript, running tests, and packaging the release artifact." > "Docker entry point script handling signal forwarding and graceful shutdown." > "Environment setup script installing dependencies and configuring development tools."