Well, it won't switch -- keeps telling me histexpand is off. I suppose it's because it is
in the subshell invoked with my slashbang (sic) line. So how would one go about getting the "real" state of histexpand, for the shell that starts when my dotfiles are sourced?
I pared down one part of the script to read:
c=$(set -o | grep histexpand)
if [[ "$c" =~ *on* ]]; then
echo -e "History expansion is currently ON."
and ran it. set -o with grep echo'ed
which of course failed to satisfy the 'if' condition. This is how I knew the state of things was different in the script's shell from my session shell.
set -o | grep histexpand
from the terminal session gave me an on
So how would one get the parent shell state, if that's the right term for it?
Looking forward to a reply.