$histchars
–
Control History Expansion, Quick Substitution, and Tokenization
$histchars
contains up to three characters:
- history expansion character: Defines the start of a history expansion. Default value:
!
. - quick substitution character: The character, which starts a substitution, when it’s first on a line. Default
value:
^
. - end-of-line comment character (optional): The character, where an end-of-line comment begins. Default value:
#
Links
Examples
- Quick substitution to print
hello world
1 2 3 4 5
echo hello # here comes the quick substitution # to replace "hello" of the previous # command with "hello world" and run it ^hello^hello\ world^
- Now use a custom substitution character
1 2 3
histchars='!@' echo hello @hello@hello\ world@
BashSupport Pro ist eine Bash IDE mit Unterstützung für $histchars – probieren Sie es aus!