Dave Land wrote:

> On Jan 8, 2007, at 3:03 PM, Dave Land wrote:
> 
> > Happily, Apple provided a utility that handles it for you:
> >
> >    defaults read "${HOME}/.MacOSX/environment"
> 
> Actually, making this work in bash (or other shell) requires a little  
> more than just reading the file... Here's the relevant chunk from  
> my .bashrc:
> 
> # Get environment variables from ~/.MacOSX/environment.plist
> # (This avoids the sin of duplicating data here and in that file)
> if [[ `uname` == 'Darwin' ]] ; then
>     defaults read ~/.MacOSX/environment | grep -v '[{}]' | tr '"' "'" |  
> awk '{ print "declare -x",$1"="$3 }' | while read -r OneLine; do eval  
> $OneLine; done;
> fi
> 
> To give credit where it's due, this came from a comment on  
> macosxhints.com.
> 
> The conditional (if [[ `uname` == "Darwin' ]]) is because I use this  
> same .bashrc across several hosts, including Solaris, Linux, and Mac  
> OS X.

This issue comes up often enough that it deserves a section in the help.
Could you perhaps write some text?  If you can send me a patch that
would be great.

-- 
hundred-and-one symptoms of being an internet addict:
4. Your eyeglasses have a web site burned in on them.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

Reply via email to