- linux下执行sh脚本,提示Command not found
- shell脚本,遇到换行时候执行错误
- 2020-01-31$'\r': command not fou
- Linux下,执行命令后,提示“-bash: XXX: comm
- MAC mysql command not found
- linux下提示命令找不到:-bash:command not
- -bash :gradlew command not found
- Android studio 在Mac下执行 gradlew语句
- ubuntu执行sh脚本Syntax error: "(" un
- 遇到/bin/sh: mysql_config: command
1、确保用户对文件有读写及执行权限
chmod a+x test.sh
2、然后修改文件格式(如果是从winodws搬过来的会显示dos格式,要把它改成unix格式)
(1)使用vi工具
vi test.sh
(2)利用如下命令查看文件格式
:set ff 或 :set fileformat
可以看到如下信息
fileformat=dos 或 fileformat=unix
(3) 利用如下命令修改文件格式
:set ff=unix 或 :set fileformat=unix
:wq (存盘退出)
3、最后再执行
./test.sh
网友评论