为什么我会收到&QUOT:无此类文件或目录"当试图执行一个bash脚本? [英] Why am I getting ": No such file or directory" when trying to execute a bash script?

查看:112
本文介绍了为什么我会收到&QUOT:无此类文件或目录"当试图执行一个bash脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图执行一个bash脚本(GIT-FTP),但我似乎无法做到这一点。这是发生了什么:

I'm trying to execute a bash script (git-ftp) but I can't seem to do it. This is what happens:

[trusktr@rocketship ~]$ ~/scripts/git-ftp
: No such file or directory

该文件具有权限755。

The file has permissions 755.

这是脚本的内容: http://pastie.org/3567556

为什么会出现这个错误?我能做些什么来解决这个问题?

Why am I getting this error? What can I do to fix the problem?

推荐答案

我已经看到,如果脚本有Windows行结尾,而不是Unix行结尾的这个错误。尝试在脚本运行 DOS2UNIX的,看看你得到同样的错误。

I have seen this error if the script has windows line endings instead of unix line endings. Try running dos2unix on the script and see if you get the same error.

这篇关于为什么我会收到&QUOT:无此类文件或目录"当试图执行一个bash脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆