原文:关于ubuntu下shell脚本 source command not found

在shell脚本的第一行通常为 bin sh,指定执行shell script的解释器版本。有bash,dash等。Bash GNU Bourne Again Shell 是许多Linux发行版的默认Shell。事实上,还有许多传统UNIX上用的Shell,例如tcsh csh ash bsh ksh等等,Shell Script大致都类同。 bash的命令语法是Bourne shell命令语法的 ...

2017-08-14 11:40 0 3772 推荐指数:

查看详情

Ubuntu18 Shell脚本出现 $'\r': command not found

出现这种问题一般就是脚本是在win平台下的,所以是属于dos指令,需要安装 dos2unix ,来转换成unix系统脚本: 使用方法,假设是对 test.sh 文件进行转换: 之后再用bash就一切正常了: ...

Wed Jun 10 19:04:00 CST 2020 0 600
ubuntu系统shellsource: not found错误

错误: shell脚本中含有source命令运行时提示 source: not found 测试: 运行 ls -l /bin/sh 后显示/bin/sh -> dash 这说明是用dash来进行解析的。 解决方案: 命令行执行:dpkg-reconfigure ...

Sat Jan 13 04:47:00 CST 2018 0 2347
shell脚本运行报错$'\r': command not found

执行个别shell测试脚本运行报错$'\r': command not found 考虑到可能是windows与Linux的换行符不同的原因(windows是\r\n,Linux是\n)造成的,但是又不想一个个替换。 可以使用如下命令来解决: # vi 脚本名 命令行模式输入 ...

Tue Mar 31 20:54:00 CST 2020 0 1318
执行shell脚本出现command not found问题

zhi前之前遇到了一个问题,用点杠直接执行shell脚本./提示command not found 这种情况可以试者声明bash,即 bash ./shell.sh 不知道跟#! /bin/bash 的声明有没有关系 另外就是脚本的读写权限不足,修改脚本的权限之后就可以正常执行 ...

Tue Sep 15 23:46:00 CST 2020 0 1290
Shell脚本出现$'\r': command not found

Centos7执行shell脚本报错如下 原因 这是因为脚本文件可能在window弄过,有window的空行,把他转换成unix格式的就行 解决办法 然后再执行这个脚本就可以了 ...

Mon Mar 18 23:50:00 CST 2019 0 5797
执行shell脚本出错'\r': command not found

在linux中执行脚本时出错 $'\r': command not found 错误原因是在脚本中有空行,如果脚本是在Windows进行编辑之后上传到linux上去执行的话,就会出现这个问题。 因为win的空行是/r/n,但是linux是/n,没有识别/r,所以会导致上述 ...

Fri Nov 30 01:08:00 CST 2018 0 968
shell脚本执行错误 $'\r':command not found

存现这种错误是因为 编写的 shell脚本是在win编写的,每行结尾是\r\n 的Unix 结果行是\n 所以在Linux运行脚本 会任务\r 是一个字符,所以运行错误,需要把文件转换下 方法一、 sed -i 's/\r//' 脚本名 方法二、 yum -y install ...

Thu Aug 01 01:02:00 CST 2019 0 6329
解决Shell脚本$'\r': command not found问题

造成这个问题的原因是Windows的空行,我们只需要把文件转成unix就好 Centos,执行yum install dos2unix,然后dos2unix [file],再执行shell命令就好了 ...

Mon Dec 09 19:28:00 CST 2019 0 326
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM