To try to help I will show you how to do the process using a BASH script.
IMPORTANT: The "PATH" environment variable must receive in its configuration a folder (eg: "/home/<YOUR_USER>/.scripts/zsh") and not a binary or script directly (eg: "/home/<YOUR_USER>/.scripts/zsh/my_bash_script").
Install a BASH script as an integrated terminal command
Make the BASH script executable
Run the following command to make "my_bash_script" script executable...
chmod +x /home/<YOUR_USER>/.scripts/zsh/my_bash_script
Add the BASH script to the PATH
Run the following command to temporarily add the BASH script directory to your "PATH"...
export PATH=$PATH:/home/<YOUR_USER>/.scripts/zsh # Logged in as your user!
Add this line to the end of your ".zshrc" file so that it's automatically added each time you start a terminal session...
echo 'export PATH=$PATH:/home/<YOUR_USER>/.scripts/zsh' >> ~/.zshrc
Reload the ".zshrc" File
To apply the changes immediately, run...
source ~/.zshrc # Logged in as your user!
Set Permissions
Next, you'll need to ensure that the BASH script have the correct permissions...
chown -R <YOUR_USER>:<YOUR_USER> /home/<YOUR_USER>/.scripts/zsh
chmod -R 700 /home/<YOUR_USER>/.scripts/zsh
You're Done! 😎
.zshenv
, not in.zshrc
...