/usr/bin/env bad interpreter

半城伤御伤魂 提交于 2019-12-02 06:37:19

/users/zmjones/.ec2/bin/ec2-add-keypair has DOS line-endings.

To fix:

mv /users/zmjones/.ec2/bin/ec2-add-keypair /users/zmjones/.ec2/bin/ec2-add-keypair.bak
tr -d '\r' < /users/zmjones/.ec2/bin/ec2-add-keypair.bak > /users/zmjones/.ec2/bin/ec2-add-keypair

This happened to me on Windows because I had the wrong header in my bash files. I had #!/usr/bin/bash instead of #!/usr/bin/env bash which is the portable version.

user1257143

I got the exactly the same problem.

The CAUSE of the problem is the "unarchiver tool".

I've installed a third party unarchiver tool. It might change the line-endings of the files during the unzipping process.

After I realized this, I deleted this tool and re-unziped the EC2 zip ball using the native unzip tool. And the problem was solved.

Hope this might be useful for you guys with the same problem.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!