Updating Profile from script

I am trying to figure a way to update an environmental variable in my .profile from script.

I have a variable name CON_DIR in my .profile.

I want to be able to update this variable directly via another unix script.

Any ideas?

Thanks.

What shell?

Korn shell

In your script
export CON_DIR=<variable value>

I think that he wants to cause a permanent change to .profile so it will affect the next login. If this is true, in .profile I would do...
export CON_DIR=$(<condir.txt)
then put "/a/b/c" or whatever in condir.txt

Later, any script can put a different path in condir.txt to change the next login. The script can also change its envirornment as encrypted mentioned, but when the script exits, the parent shell will still have the old environment. So the parent might also need to change CON_DIR.

I figured out a workaround. Not very elegant but does the trick.
Thanks.