In your terminal, `echo "Deploy done!"` fails with `bash: !": event not found`.
IntermediateTroubleshootingTroubleshooting: syntax, parsing and interpreter errors
Answer
Likely causes → Interactive history expansion: ! inside double quotes refers to history. It does not happen in scripts (history expansion is off in non-interactive shells), which is why the same line works in a script.
Diagnose → echo $- shows H when history expansion is on.
Fix → Use single quotes (echo 'Deploy done!'), escape it (\!), put ! at the end outside quotes, or set +H in the interactive shell.
Prevent → Use single quotes for literal strings when testing interactively.
More on Troubleshooting: syntax, parsing and interpreter errors
`./deploy.sh` fails with `bash: ./deploy.sh: /bin/bash^M: bad interpreter: No such file or directory` (or, on Bash 5.2, `cannot execute: required file not found`).Beginner`bash: ./backup.sh: Permission denied` right after cloning the repo.Beginner`deploy.sh: line 14: syntax error near unexpected token `fi'`Beginner`install.sh: line 87: syntax error: unexpected end of file`Beginner`warning: here-document at line 12 delimited by end-of-file (wanted `EOF')` and the rest of the script never runs.Beginner`bash: [: missing `]'`Beginner