当试图在linux上运行shell脚本时,"无法执行二进制文件"

您所在的位置:网站首页 ssh文件在哪个文件下面 当试图在linux上运行shell脚本时,"无法执行二进制文件"

当试图在linux上运行shell脚本时,"无法执行二进制文件"

#当试图在linux上运行shell脚本时,"无法执行二进制文件"| 来源: 网络整理| 查看: 265

我对linux和shell脚本非常陌生。 我试图用下面的命令从Linux的安全壳(ssh)中运行一个shell脚本。

chmod +x path/to/mynewshell.sh sh path/to/mynewshell.sh

I get this error:

path/to/mynewshell.sh: path/to/mynewshell.sh: cannot execute binary file.

试着使用这个命令。

bash path/to/mynewshell.sh

我得到同样的错误。

用这个命令试过了。su - myusername sh path/to/mynewshell.sh 它要求我输入密码,并给我这个错误。no such file or directory。

1.cat -v path/to/mynewshell.sh的结果是。 ^@^@^@^@^@^@^@^@Rscript "$dir"/diver_script.R 完成

2.当尝试 "less path/to/mynewshell.sh "时,我在终端上得到了这个结果。

#!/bin/bash/Rscript^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@ ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@ for dir in /path/to/* ; do ^@^@^@^@^@^@^@^@Rscript "$dir"/myRscript.R done

3.当我运行文件path/to/mynewshell.sh时:我得到这个 "Bourne-Again shell脚本文本可执行"

请给我任何建议,我可以尝试执行shell脚本。



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3