On windows/cygwin, i want to be able save the PATH variable to file on one machine and load it onto the other machine;
for storing the variable i am doing:
echo %PATH% > dat
however, not sure how to load it later.
set PATH=???????
Thanks Rami
You can set default values for environment variables using a .env file, which Compose automatically looks for in project directory (parent folder of your Compose file). Values set in the shell environment override those set in the .env file.
To make permanent changes to the environment variables for all new accounts, go to your /etc/skel files, such as . bashrc , and change the ones that are already there or enter the new ones. When you create new users, these /etc/skel files will be copied to the new user's home directory.
Just use: set /P PATH=< dat
You must note that echo %PATH% > dat
insert an additional space after %PATH% value; that space may cause problems if an additional path is later added to PATH variable. Just eliminate the extra space this way: echo %PATH%> dat
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With