I am on MacOS (12.6.1, Monterey) running Emacs 29.1 (installed from https://emacsformacosx.com). I have a set of shell scripts that I have often use with shell-command-on-region
(M-|
); the scripts are all stored in a ~/bin
.
While this worked previously, I now need to enter the full path for this command to work. (I need to enter ~/bin/script.sh
rather than just script.sh
.)
What is weird is that tab completion for these scripts works in the minibuffer; and if I inspect the variable exec-path
, the appropriate directory is there. (If I'm in a shell, I can just use the script name.) If I use the full path for a script (~/bin/script.sh
) with shell-command-on-region
, that works too. But if I use just the script name I get this error: zsh:1: command not found: script name.sh
So, is there some variable other than exec-path
that shell-command-on-region
uses that needs to be set? Mac recently switched its default shell from bash to zsh--could that somehow be the cause?