Consider the following commands for overriding the history expansion characters (which I got from *Learning Shell Scripting with ZSH* book):
% set histchars='@^#'
% ls *.txt
file1.txt file2.txt
% @@
Result:
zsh: command not found: @@
However, this works (note that set
is omitted):
% histchars='@^#'
% ls *.txt
file1.txt file2.txt
% @@
Result:
ls *.txt
file1.txt file2.txt
I tried both with my .zshrc
and with a vanilla shell (zsh --no-rcs
), the result is the same.
Question: is the set ...
syntax wrong in the book, or am I missing something?
Asked by Attilio
(385 rep)
Feb 23, 2023, 06:33 PM