-bash:":事件未找到 [英] -bash: !": event not found

查看:179
本文介绍了-bash:":事件未找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我该如何解决这个问题的bash终端?为什么会产生!突然成为一个问题,以及需要引号似乎不再是必要的,以产生该字符串。难道我碰坏?如果让我怎么恢复成出厂设置?我敢肯定,这是正常的工作昨天

How do I fix this bash terminal? Why would the '!' suddenly be a problem and the need for quotation marks are no longer seem to be necessary to produce the string. Did I break something? If so how do I reset it to factory setting? I'm sure it was working properly yesterday

Last login: Sat Oct 18 15:30:48 on ttys001
Michels-MacBook-Pro:~ michelfrechette$ echo "hello, world!"
-bash: !": event not found
Michels-MacBook-Pro:~ michelfrechette$ echo hello, world
hello, world
Michels-MacBook-Pro:~ michelfrechette$ echo "hello, world"
hello, world 

-bash:!:找不到事件,这是奇怪的。

推荐答案

运行<​​/ P>

set +H

将关闭其全部违规(历史扩展)功能。在此把你的〜/ .bashrc中是一种常见的做法。

另外,你可以修改 histchars 变量来改变用来触发历史扩展(默认字符,),快速替换(默认情况下, ^ )和评论(默认情况下,)。

Alternately, you can modify the histchars variable to change the characters used to trigger history expansion (by default, !), quick substitution (by default, ^) and comments (by default, #).

作为另一种选择,采用单而不是双引号避免了引发问题的壳特征。

As yet another option, using single- rather than double-quotes avoids triggering the shell feature in question.

这篇关于-bash:&QUOT;:事件未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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