This kind of problem is common for my compatriots who like to use windows to edit the .sh file and then move it to the linux environment. Of course, you may also be a thieves in linux, just lazy
The cause of the problem :
The editing in windows may not meet the content format requirements of linux editing. It feels the same to the naked eye, but in fact we are always confused by the superficial phenomena of these two guys
Problem solving :
①Install sudo apt install dos2unix first
, the developer has already thought of our problem
②Run dos2unix xx.sh
If you bash again, there will be no error report
(over)