网站首页 美食营养 游戏数码 手工爱好 生活家居 健康养生 运动户外 职场理财 情感交际 母婴教育 生活知识 生活百科 知识问答 更多知识

shell脚本内容拷贝出来 执行正常 sh执行报错

时间:2026-04-24 06:35:54

1、shell脚本test.sh内容是

find /home/feel/ -name test.txt;

find /home/feel/ -name test2.txt;

find /home/feel/ -name test3.txt;

拷贝出来,放到命令行,执行正常。

shell脚本内容拷贝出来 执行正常 sh执行报错

2、sh test.sh,执行报错。

①②③: command not found

shell脚本内容拷贝出来 执行正常 sh执行报错

3、报错原因,test.sh在windows编写,windows的某些字符和Linux不一样,导致在Linux执行失败。

shell脚本内容拷贝出来 执行正常 sh执行报错

4、解决方法,在Linux删除在windows创建的test.sh,创建文件test.sh,执行正常。

shell脚本内容拷贝出来 执行正常 sh执行报错

© 2026 智德知识库
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com