在 Ubuntu 10.10 错误的 bash 命令后停留在 > 终端提示
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/39896739/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Stuck on > prompt in terminal after bad bash command, Ubuntu 10.10
提问by Trevor Bosco Fernandes
After typing a bad command in terminal like below, the prompt does not exit. Tried Ctrl+c, Ctrl+z, Ctrl+q. Nothing helps to exit > prompt.
在如下终端中输入错误命令后,提示不会退出。尝试了 Ctrl+c、Ctrl+z、Ctrl+q。退出 > 提示没有任何帮助。
[[email protected]|eco9]# vi /etc/lru.cfg'
>
> vi /etc/lru.cfg
>
>
>
采纳答案by Eugene Yarmash
Bash waits for you to terminate the quoted string with another single quote character. So you can either do 'Enterand exit vi
in a normal way, or use Ctrl + Cto cancel the command.
Bash 等待您用另一个单引号字符终止引用的字符串。因此,您可以以正常方式执行'Enter和退出vi
,也可以使用Ctrl + C取消命令。
">"
is the default value of the $PS2
variable, a.k.a secondary prompt string.
">"
是$PS2
变量的默认值,也就是二级提示字符串。
回答by choroba
Ctrl + Cworks for me. Anyway, try adding the closing single quote and Enter.
Ctrl + C对我来说有效。无论如何,尝试添加结束单引号和Enter。
回答by wrwrwr
How about Ctrl + D, or just 'and Enter(and then :qto exit vi
).
怎么样Ctrl + D,或者只是'和Enter(然后:q退出vi
)。