I'm trying to replace the value of an environment variable definition, if it exists, from a bash script. I know I can use sed to do this, I'm not sure, however, how to replace the value of the environment variable?
Here's what I'd like to do:
Given a file with this line (found with grep):
export MY_ENV=SOME_VALUE
I'd like to replace SOME_VALUE with something else. How do I do that with sed?