Interview Prep/Shell Scripting/Troubleshooting: syntax, parsing and interpreter errors

`deploy.sh: line 3: APP_ENV: command not found`

BeginnerTroubleshootingTroubleshooting: syntax, parsing and interpreter errors
Answer

Likely causes → Spaces around = in an assignment: APP_ENV = prod runs a command named APP_ENV. Variants: APP_ENV= prod (sets APP_ENV to empty for the command prod), or a leading $ ($APP_ENV=prod).

Diagnose → sed -n 3p deploy.sh.

Fix → APP_ENV=prod with no spaces.

Prevent → ShellCheck reports SC1068 ("Don't put spaces around the = in assignments").

All Shell Scripting questions Roadmap: Shell scripting (Bash)

More on Troubleshooting: syntax, parsing and interpreter errors