About Solving Unresolved Commands in Zsh or Bash Scripts

If you use BashSupport Pro plugin with PyCharm and some of commands (like mkdir, date, ansible-playbook, npm, etc.) are not recognized, you need to make sure that the PATH environment variable has those values and is set by the script.

One of the ways of doing that is to set the PATH variable in ~/.zshrc or ~/.bashrc file as one of the first directives:

1
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH"

Then source that file to your script that you run through the BashSupport Pro plugin:

1
2
3
#!/usr/bin/env zsh
source ~/.zshrc
# other directives

Tips and Tricks Dev Ops Development Bash Zsh PyCharm