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

前端 未结 5 971
执笔经年
执笔经年 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:17

    To anyone else having the problem i had.

    i was trying to run a 16 bit unicode text file converted to a shell script, this doesn't work as all 16 bit unicode text files have a 0xFFFE marker at the start making mac os not like the file and this gives the “cannot execute binary file” error.

    open the text file click on "Format" at the top, go down to "Make Plain Text" click it.

    open your terminal type chmod 777 /path/to/file.sh

    put in terminal: /path/to/file.sh to run it

提交回复
热议问题