获取/bin/bash:-c:第0行:寻找匹配的`''时出现意外的EOF [英] Getting /bin/bash: -c: line 0: unexpected EOF while looking for matching `''

查看:430
本文介绍了获取/bin/bash:-c:第0行:寻找匹配的`''时出现意外的EOF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Gitbash有问题.每当我在drush命令下运行时,我都会报错

命令:drush @site sqlq从表名中选择*"

错误:/bin/bash:-c:第0行:寻找匹配的`''时出现意外的EOF /bin/bash:-c:第1行:语法错误:文件意外结束

我尝试运行简单的drush命令,例如drush @site cc all,它们运行正常.

此问题与系统配置或任何与环境变量相关的问题有关吗?我试图在其他系统中运行此命令,它运行正常.我无法在这里找出问题所在,请帮忙.

解决方案

Git bash表示 Windows版Git .

首先检查您的.bashrc(在%USERPROFILE%中):如果有,请确保它在执行时没有将任何字符串回显到stdout(您可以通过在git bash source /c/Users/<You>/.bashrc中键入来查看.

然后再尝试使用CMD进行的git bash设置,其中设置了简化的路径

要进行测试,请下载[PortableGit-2.17.0-64-bit.7z.exe] [2]并解压缩其内容.

set G=c:\path\to\latest\git
set PATH=%G%\bin;%G%\usr\bin;%G%\mingw64\bin
set PATH=%PATH%;C:\windows\system32;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\

还为drush命令添加PATH,然后在该CMD中使用简化的PATH在git bash中重试该命令.

I have a problem with my Gitbash. whenever I am running below drush command I am getting error

command : drush @site sqlq "select * from tablename"

error : /bin/bash: -c: line 0: unexpected EOF while looking for matching `'' /bin/bash: -c: line 1: syntax error: unexpected end of file

I tried to run simple drush commands like drush @site cc all and they are working fine.

Is this issue related to system configurations or any environment variable related problem? I tried to run this command in other system and it is working fine. I am not able to figure out what is the issue here Please help.

解决方案

Git bash means Git for Windows.

Check first your .bashrc (in %USERPROFILE%): if you have one, make sure it does not echo any string to stdout when executed (you can see that by typing in git bash source /c/Users/<You>/.bashrc.

Then try again with a git bash done from a CMD where you set a simplified PATH

For testing, download [PortableGit-2.17.0-64-bit.7z.exe][2] and uncompress its content anywhere you want.

set G=c:\path\to\latest\git
set PATH=%G%\bin;%G%\usr\bin;%G%\mingw64\bin
set PATH=%PATH%;C:\windows\system32;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\

Add also the PATH for the drush command, then try again said command in a git bash done from that CMD with that simplified PATH.

这篇关于获取/bin/bash:-c:第0行:寻找匹配的`''时出现意外的EOF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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