What it means /bin/bash^M: bad interpreter?

11,048

It means your script file has MSWin line endings. Use dos2unix or fromdos to fix them.

Share:
11,048
Vahagn Aleksanyan
Author by

Vahagn Aleksanyan

Updated on June 04, 2022

Comments

  • Vahagn Aleksanyan
    Vahagn Aleksanyan almost 2 years

    I create start.sh file and wont to start,but retruned me

    ./start.sh: /bin/bash^M: bad interpreter: No such file or directory
    

    this is my start.sh file content

    #!/bin/bash
    cd /home/test/Desktop
    node cron.js
    

    How can I fixed this problem?

  • Vahagn Aleksanyan
    Vahagn Aleksanyan almost 6 years
    How can I fixed problem?
  • choroba
    choroba almost 6 years
    Do you have dos2unix or fromdos installed?
  • Vahagn Aleksanyan
    Vahagn Aleksanyan almost 6 years
    I instaled fromdos,but dont know how to use.
  • choroba
    choroba almost 6 years
    See man fromdos to see the manual page.