How to solve “bad interpreter: No such file or directory”

前端 未结 6 1256
礼貌的吻别
礼貌的吻别 2021-01-31 08:12

I\'m trying to run a sh script and get the following error on Mac:

/usr/bin/perl^M: bad interpreter: No such file or directory

How

6条回答
  •  日久生厌
    2021-01-31 08:39

    You seem to have weird line endings in your script: ^M is a carriage return \r. Transform your script to Unix line endings (just \n instead of \r\n, which is the line ending on Windows systems).

提交回复
热议问题