Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Copy variables from command line to GUI environments' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Copy variables from command line to GUI environments
Authored by: hopthrisC on Jul 23, '04 10:24:05AM

Um... Why?

1. It might not be wise to copy _all_ set variables to the environment.plist. Some of them are set dynacially by the shell, and who knows if they'll be overwritten at login time and what the effect would be...?

2. No need to keep anything in sync by hand, because all the Variables from the environment.plist file are inherited by the terminal and the shell. Just set them in environment.plist and forget about .bashrc!



[ Reply to This | # ]
Copy variables from command line to GUI environments
Authored by: hopthrisC on Jul 23, '04 11:00:18AM
For the daring:

$ cd .MacOSX
$ mv environment.plist ../Library/Preferences/
$ ln -s ../Library/Preferences/environment.plist .

now you can use

$ defaults write environment VARIABLE "content"
$ defaults delete environment VARIABLE "content"

to set the content of VARIABLE to "content".

Note: This will not work if there's anything that writes to your environment.plist during login (or even later), like sshLogin.

[ Reply to This | # ]

Copy variables from command line to GUI environments
Authored by: gdsimms on Jul 23, '04 01:04:36PM

You are correct. After running this script and a logout/login, I could not open a terminal session because of some logic I put in my .bashrc that depends on what is already defined in environment vars.

Also, inexplicably, dragging icons in the finder and desktop was broken.(!) Selecting, context menu, key commands on files worked fine, but dragging just did not happen. What possible cause could there be for this?



[ Reply to This | # ]
Regarding "can't drag"?
Authored by: frodeaux on Jul 26, '04 09:31:03AM

It is reported that any definition of "SECURITYSESSIONID" in
environment.plist causes the "can't drag" behavior you
describe.

If you look at the script of the original article, you'll see that the
variable is explicitly NOT copied into environment.plist. I wonder if its definition somehow got into your environment.plist? Any other "odd" definitions?

---
"Everyone's Entitled To Their Own Crummy Opinion."



[ Reply to This | # ]