Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sh: How to extend environment variables?

Everywhere you can read how to replace environment variables. But I want to insert a new path at the beginning of my $PATH variable. What's the simplest way to do this using sh?

like image 529
fridojet Avatar asked Oct 19 '25 16:10

fridojet


1 Answers

Just assign it a new value that includes the old:

PATH=/new/path:${PATH}
like image 185
Alex Howansky Avatar answered Oct 21 '25 04:10

Alex Howansky



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!