执行shell脚本报错 cannot execute binary file
来源:互联网 发布:淘宝加盟店辨别真假 编辑:程序博客网 时间:2024/06/05 00:14
现象:我本地编写了shell脚本,拷贝到某台SUSE11服务器上执行正常,到suse10机器上就报错了
通常情况下这个错误的原因有以下几个
1、可能是没有执行权限;
2、可能是32位机器跑了64位写的程序;
3、可能用了ARM机器跑X86生成的代码。
然而我这个就是个shell文件,不至于啊,一Google也没有类似案例,用file命令一查,清楚了
# file newMemEnv.sh newMemEnv.sh: UTF-8 Unicode text正常机器上
# file newMemEnv.sh newMemEnv.sh: UTF-8 Unicode (with BOM) text问题清楚了,我在windows下编辑的文件虽然是UTF-8的,但是windows加上了隐藏字符,导致linux下执行时解析shell文件报错,不认为是可执行文件
使用notepadd++修改编码为UTF 无BOM后,问题解决
为什么拷贝过去到suse11上没问题,suse10上有问题呢?正好suse11的bash兼容了bom字符处理了呗
0 0
- 执行shell脚本报错 cannot execute binary file
- CentOS 报错cannot execute binary file
- linux 中安装JDK后执行java报错 :-bash: bin/java: cannot execute binary file
- cannot execute binary file
- cannot execute binary file
- cannot execute binary file
- 使用aapt解析apk信息报错“cannot execute binary file”
- error: cannot execute binary file
- cannot execute binary file处理
- linux - cannot execute binary file
- JAVA cannot execute binary file
- cygwin:as.exe: cannot execute binary file
- 请教 cannot execute binary file问题
- java: cannot execute binary file错误
- -bash: ./firstdrvtest: cannot execute binary file
- bash: ./java: cannot execute binary file 问题
- 【ubuntu】bash: cannot execute binary file
- Ubuntu bash: ./java: cannot execute binary file
- 51Nod-1080-两个数的平方和
- 重建二叉树
- Mongodb 数据类型
- 332. Reconstruct Itinerary
- 利用选择排序为shell排序提速
- 执行shell脚本报错 cannot execute binary file
- Android Service与Activity之间通信的几种方式
- 项目搭建git和github的使用
- 推荐一些国内的Jquery CDN免费服务
- SpringBoot+Logback+Sentry(日志监控平台)
- diff
- Linux 常用命令 之 搜索命令
- opencv程序编译后执行找不到库
- Linux 常用命令 之 压缩命令