Howdy folks, hoping to get some advice here on setting the ENV_PATH
variable for multiple devices and scripts.
For instance, I run a variety of shell scripts on my iMac, both OS scripts and home brew scripts, as well as on my wife's MacBook, also OS and home brew. My iMac is running Big Sur, while the MacBook is running Monterey.
The path for OS shell scripts is apparently different for the two OS (no surprise), so initially I was just running a subroutine before any shell script action that would set the variable according to the device's UUID to differentiate between my iMac and her MacBook. However, now that I run home brew scripts on both devices, it has added a level of complexity in defining where the heck the proper path is for any given shell script.
So I'm hoping to get some ideas as to the best way to set the ENV_PATH
variable depending on what device and what kind of script I'm running. I was thinking of having the subroutine first use a switch action to ID which device I'm on using the same %MacUUID%
token I'm currently using, and then inside of that switch action, another switch that will run according to the %TriggerValue%
token. For instance, I could supply the token of homebrew
to indicate that the script is a homebrew script and needs to use that path, and leave the parameter empty to run OS scripts.
But since I'm still relatively new at running shell scripts, and don't want to screw anything up I'm hoping some of the more knowledgable folks can chime in with their ideas. Any help is appreciated!
-Chris