prefix-dev / shell

The ultimate cross-platform, bash-like shell
MIT License
35 stars 5 forks source link

How to append to PATH #90

Open certik opened 1 week ago

certik commented 1 week ago

Especially on Windows with some absolute paths. So far I haven't figured it out.

certik commented 1 week ago

I figured out a workaround: I first print the $PATH, then I copy & paste it into a line like:

export PATH='C:\Users\ondrejcertik\bin;<PASTE HERE>'

And that works. It looks like possibly environment variable expansion inside the export string does not work. There is also the issue of ' vs ". But at least the above allows manual workaround.

certik commented 1 week ago

I now do:

echo $PATH > ~/.shellrc

Edit ~/.shellrc to do export PATH=' ... '. And put the path I want at the front. Then:

source ~/.shellrc

This is relatively simple now and works very well. I have a script for each environment.