Assign with NAME=value without spaces around =. Export marks variables for child processes: export PATH="$HOME/bin:$PATH". Command substitution captures output: today=$(date +%F) or legacy backticks. Prefer $() — it nests cleanly.
Examples
Assign with NAME=value without spaces around =. Export marks variables for child processes: export PATH="$HOME/bin:$PATH". Command substitution captures output: today=$(date +%F) or legacy backticks. Prefer $() — it nests cleanly.