Tag Archives: :set ff? /bin/bash^M: bad interpreter: No such file or directory

How to Solve Error: set ff? /bin/bash^M: bad interpreter: No such file or directory

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