$HISTCHARS
–
Definition of History Expansion and Comment Parsing (Deprecated)
$HISTCHARS
defines how the Zsh shell handles history expansion and how it parses line comments.
This variable is deprecated, the lowercase $histchars
should be used instead.
The value contains three ASCII characters:
- Character for a history expansion. Default:
!
. - Character for a quick history substitution. Default:
^
. - Character to start a line comment. Default:
#
.
Links
- The Z Shell manual
- The Z shell manual on history expansion
- The Z shell manual on option
INTERACTIVE_COMMENTS
to enable comments in interactive shells
Examples
- Change line comment character for a script
- Output:
1 2 3 4 5
#!/usr/bin/env zsh # Tell Zsh that underscore _ now start a line comment HISTCHARS[3]='_' _ new line comment echo hello world
1
hello world
BashSupport Pro ist eine Zsh IDE mit Unterstützung für $HISTCHARS - probieren Sie es jetzt aus!