Inspect without changing
file deploy.sh
cat -v deploy.sh | headIf you see CRLF, ^M, or /bin/bash^M, line endings are the likely cause.
RiskBack up the target script before conversion. Do not run bulk replacements across an unknown directory.
Repair only the target
sed -i 's/\r$//' deploy.shThen verify the shebang and executable permission. You can also invoke the interpreter explicitly with bash deploy.sh.
Success checks
fileno longer reports CRLF.cat -vshows no^M.- A minimal command runs before the full deployment is retried.