bin bash No such file or directory 解决方法

发布时间: 更新时间: 总字数:115 阅读时间:1m 作者: IP上海 分享 网址

bin bash: No such file or directory 解决方法

错误提示

./bash.sh: line 1: *!/bin/bash: No such file or directory

执行脚本报警告信息。

原因及解决方法

Windows的回车换行(\r\n)和Linux的回车换行(\n)是不同的。

安装dos2unix

yum install dos2unix -y

执行:

dos2unix bash.sh

重新保存文件,去掉 unicode 签名就好了。

Home Archives Categories Tags Statistics
本文总阅读量 次 本站总访问量 次 本站总访客数