【已解决】-bash: ./deploy.sh: /bin/bash^M: bad interpreter: No such file or directory

This error is usually caused by an incorrect format of the script file, which may be caused by the script file being created on a Windows system and then run on a Linux system.

You can try to convert the format of the script file to Unix format using the following command:

dos2unix deploy.sh


This command will convert the format of the deploy.sh file from Windows format to Unix format, thereby solving the problem that the script file cannot be executed.

If the dos2unix command is not installed on your Linux system, you can use the following command to install it:

yum -y install dos2unix*


After the installation is complete, run the dos2unix command again.

Guess you like

Origin blog.csdn.net/wufaqidong1/article/details/133794222