免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 10007 | 回复: 11
打印 上一主题 下一主题

command not found. [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-02-27 23:45 |只看该作者 |倒序浏览
我建立了一个test.sh文件,我这样 ! test.sh
为什么 系统却说command not found.

论坛徽章:
0
2 [报告]
发表于 2004-02-27 23:54 |只看该作者

command not found.

chmod +x test.sh

论坛徽章:
0
3 [报告]
发表于 2004-02-28 00:02 |只看该作者

command not found.

谢谢回复,但是还是没有用,我用的是bash.

论坛徽章:
0
4 [报告]
发表于 2004-02-28 03:02 |只看该作者

command not found.

chown owner file

论坛徽章:
0
5 [报告]
发表于 2004-02-28 05:26 |只看该作者

command not found.

. test.sh
source test.sh
sh test.sh
bash test.sh
chmod a+x test.sh; ./test.sh
但!test.sh
的意思是说在命令历史列表里查找最近使用过的以test.sh开头的那个命令, 然后执行它, 因为你的test.sh尚未被执行过一次, 所以报告说
命令没找到。意思是说在命令历史列表里还没有匹配的命令

论坛徽章:
0
6 [报告]
发表于 2004-02-28 08:22 |只看该作者

command not found.

那我要执行一个 test.sh
文件怎么执行呀!

论坛徽章:
0
7 [报告]
发表于 2004-02-28 13:17 |只看该作者

command not found.

我知道了bash test.sh.

论坛徽章:
0
8 [报告]
发表于 2004-02-28 14:12 |只看该作者

command not found.

原帖由 "welyngj" 发表:
那我要执行一个 test.sh
文件怎么执行呀!
. test.sh
source test.sh
sh test.sh
bash test.sh
chmod a+x test.sh; ./test.sh
那么多方法你任选其一喔

论坛徽章:
0
9 [报告]
发表于 2004-02-28 14:50 |只看该作者

command not found.

楼上的各位都对,但既然是“command not found”当然是路径不对了,所以可不可以用
./test.sh或者完整路径了

论坛徽章:
0
10 [报告]
发表于 2010-12-01 10:53 |只看该作者
请问这个文件(test.sh)您是在什么环境下编写的呢(我的意思是UNIX还是Windows)?如果这个文件您是在Windows下编写然后再拷贝到unix下的话,是肯定运行不了的,需要格式转换!步骤如下:
1)打开该文件 vim test.sh
2):set fileformat=unix
3):write
4):wq
5)./test.sh
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP