When I run a bash script, I'm getting the error message
env: bash\r: No such file or directory
When I run a bash script, I'm getting the error message
env: bash\r: No such file or directory
If you wrote the bash script on windows, chances are you have CRLF line endings instead of just LF.
Changing the line endings to LF should fix this problem. I was writing in VSCode, so I simply clicked CRLF in the bottom right corner and changed it to LF.
dos2unix
is also a popular program to perform this change for you.