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 ttys001Michels-MacBook-Pro:~ michelfrechette$ echo "hello, world!"-bash: !": event not foundMichels-MacBook-Pro:~ michelfrechette$ echo hello, worldhello, worldMichels-MacBook-Pro:~ michelfrechette$ echo "hello, world"hello, world
-bash: !": event not found
, this is curious.
Best Answer
Running
set +H
will turn off the offending (history expansion) functionality in its entirety. Putting this in your ~/.bashrc
is a common practice.
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.
If you are facing the 'bash event not found' error, it usually occurs when you try to execute a command that is not recognized by the bash shell. This error message indicates that the command or event you are trying to run is not found in the system's PATH. The PATH is an environment variable that specifies the directories where the shell looks for commands.
To fix this issue, you can try the following solutions:
- Check the spelling of the command you are trying to run. Make sure it is correct and properly typed.
- Verify if the command or script you are trying to run is installed or available in the system.
- Check the system's PATH variable to ensure that the directory containing the command or script is included.
- If the command or script is not in the system's PATH, you can either add its directory to the PATH or specify the full path to the command or script when executing it.
By following these steps, you should be able to resolve the 'bash event not found' error and continue with your script or command execution without any issues.