Bash treats a trailing carriage return as part of the command, so notebooks saved with CRLF endings produced broken scripts.