问题:
[root@localhost ShPbxClientJava]# ./install-service.sh
-bash: ./install-service.sh:/bin/bash^M:解释器错误: 没有那个文件或目录
错误原因:
在 Windows 里编辑过这个 .sh 脚本,导致换行符变成了 Windows 格式, Linux 不认识,所以报错
^M 就是 Windows 换行符,Linux 识别不了。
解决方法:
在麒麟系统里,进入 .sh 脚本目录,执行:
1、去掉换行符
sed -i 's/\r$//' install-service.sh
2、赋予权限
chmod +x install-service.sh
3、安装
./install-service.sh

















浙公网安备 33010602011771号