Tools
Visual Studio Code Settings
→ 日本語版を読むLine Ending Settings
The default line ending in VS Code is CRLF (\r\n).
If CRLF is mixed into Linux scripts, it causes errors, so set the line ending to LF (\n).
/bin/bash^M: bad interpreter: No such file or directory
By the way, for files that have already been created, you can open the Command Palette and use "Change End of Line Sequence" to change the line ending.
Displaying Line Endings
Make it visible whether a file uses CRLF or LF.
By installing the code-eol extension, you can distinguish between CRLF and LF at a glance.