error:
-bash: ./full_build.sh: /bin/bash^M: bad interpreter: No such file or directory
One of the reasons for the above error is that the script file is in DOS format, that is, the end of each line is marked with a line
solution 1:
Use the VIM editor to open the script and run:
:set ff?
You can see the words DOS or UNIX. Use set FF = UNIX to force it to UNIX format, and then: WQ save to exit
solution 2:
There are many other methods on the Internet, such as: executing the DOS 2 UNIX command to convert the code, and the command is:
#dos2unix full_build.sh
But I didn’t have the installation package of dos2unix, so I didn’t try to change it
Similar Posts:
- [Solved] “/bin/bash^M: bad interpreter: No such file or directory”
- [Solved] Python Error: /usr/bin/python^M: bad interpreter: No such file or directory
- shell :syntax error: unexpected end of file
- Shell script error newline syntax error near unexpected token
- shell :syntax error: unexpected end of file
- [Solved] Centos7 Execute Script Error: syntax error near unexpected token `fi’
- Solve the problem of shell script “syntax error near unexpected token ` fi ‘”.
- Conversion to MySQL shell script execution error $’\ R’: command not found
- When Linux runs SHELL file, $’\ R’: command not found appears
- The solution to the problem of syntax error near unexpected token then ‘