Shell Path Not Right

I'm using an Execute Shell Script in KM to run daily updates to Homebrew. If I run the script from the command line on my Mac, it outputs that I'm ready to brew. No errors. If I run it through KM, I get the following.

Warning: /usr/bin occurs before /opt/homebrew/bin in your PATH.
This means that system-provided programs will be used instead of those
provided by Homebrew. Consider setting your PATH so that
/opt/homebrew/bin occurs before /usr/bin. Here is a one-liner:
  echo 'export PATH="/opt/homebrew/bin:$PATH"' >> ~/.zshrc

I have verified that the path in ~/.szhrc is correct, which I'm assuming is why when I run it from CLI it works.

The script I'm running starts with #!/bin/zsh so I would think that forces it to use my profile, doesn't it? Or am I missing something.

Thanks in advance. Minor annoyance, but having errors bugs me.

KM's shell is different from regular Terminal shell.

Have you added the ENV_PATH variable to KM?

I hadn't. I just added it (screenshot), but it didn't change anything. Did I do that wrong?

Yes! Read the wiki to see how to do it here: action:Execute a Shell Script [Keyboard Maestro Wiki]

Thanks! That got it. I was getting close to that, but hadn't found that article yet.

All working as expected now.

Thanks again.

2 Likes