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