As mentioned in comments, the
zsh shell saves its command line history to the file referenced by the
HISTFILE shell variable as soon as the shell terminates, but not before that by default. You would therefore not expect to see the file spring into existence until the termination of an interactive shell with
There shell options that you may set with
setopt to write the shell's history to file after each command, e.g.
SHARE_HISTORY, but you should probably read about these and associated history-related shell options in the
zshoptions manual (
man zshoptions, then search for e.g.
Note that the history related shell variables (mentioned in the
zshparam manual) are not environment variables, and that they therefore should not be exported.