I ended up figuring this out myself, for topic closure (and in case someone else ever wants to know what I did):
Th best way I found to change a value of some environment variable (knowing that the variable is in ALL capital letters) is by doing this:
Quote:
INSTALL=SOMETHING_RANDOM
VERSION=SOMETHING_RANDOM
by executing the `sed` one-liner below, I am able to find any ALL CAPS variable that starts at the beginning of a line and has an equal sign after the variable name ( ^([A-Z]+)\= ) and replace that with it's base variable name again ( \1 ) and have it place and equal sign again following it with the new value I want ( =new_value ). As for the sed flags, '-i' is to edit the file in place, '-r' is to use extended regular expressions, and '-e' is to add expression to be executed:
Code:
sed -i -r -e "s/^([A-Z]+)\=(.*)/\1=new_value/" /path/to/my/script/environment_script.sh
Granted this is going to match *any* upper case name at the beginning of a line and change all their values to 'new_value'. I expanded on this more and use parameter substitution and whatnot, but if you're still following me by now, you've got the idea of what is going on.
Anyrate, hope someone else finds this insightful.