“cannot execute binary file” when trying to run a shell script on linux

前端 未结 5 974
执笔经年
执笔经年 2020-12-16 03:17

I am very new to linux and shell scriprting. I am trying to run a shellscript from secure shell (ssh) on linux using following commands:

chmod +x path/to/myn         


        
5条回答
  •  被撕碎了的回忆
    2020-12-16 04:09

    That script is simply not a shell script. A shell script is usually readable and contains shell code. The output your cat command shows looks indeed like it's a binary of some sort. As some note, it might be because of a file conversion issue when copying but it looks more like an actual binary to me.

    You can check what it is identified as with the file command so:

    file path/to/mynewshell.sh
    

    Just start with a clean script and rewrite the code, it looks like you just want to run some R scripts in a directory?

    Make sure the R scripts point to the right R script executioner.

提交回复
热议问题