I have a set of folders with scripts in them. These are used to setup various environments. Each folder also has a plain text file that has some settings that are read by the script (so that the settings only need to be updated in one place and can be read by the bash or powershell scripts).
I have another folder that contains scripts that take parameter to determine which folder to execute the script from. This folder in in the PATH
, so that the scripts can be called as you would an executable.
Now, I am have gotten this to work on windows, where I am a bit more familiar, however making this work on Mac has not been kind to me. I do not want (the users) to have to source
the file, I want the script to do that automagically (as is working on Windows).
script root
-scripts
--env_a
--- settings
--- bash script for env a
--- posh script for env a
--env_b
--- settings
--- bash script for env b
--- posh script for env b
-path
--set_env.sh
--set_env.bat
So on Windows, I can > set_env env_a
, and the environment variables are available to the current and child processes. How can I do the same on Mac?