No offense.
But your question has nothing to do with this topic?
It would be better to ask your questions in a new topic with its own heading.
In addition, it is always advisable to search for existing topics first....
Especially on the topic of pb-ide-tools there are countless examples to start from.
Like this: How to insert code to IDE on Mac and Linux
Keep in Mind: The environment variables are only valid when the ide is running.
So you have to create your code as executable and then call it from the ide...
Happy Coding and stay healthy.