Re: How to make cocoa apps read environment variables set in /etc/profile or /etc/bashrc?
Re: How to make cocoa apps read environment variables set in /etc/profile or /etc/bashrc?
- Subject: Re: How to make cocoa apps read environment variables set in /etc/profile or /etc/bashrc?
- From: Sherm Pendley <email@hidden>
- Date: Mon, 10 Oct 2005 14:34:37 -0400
On Oct 10, 2005, at 2:14 PM, email@hidden wrote:
I have been setting environment variables in /etc/profile and /etc/
bashrc
Don't do that. Set them in user space - ~/.profile
read those environment variables without any problems using getenv
function, my
cocoa applications are not able to read them using the same getenv
function. The
getenv function always return NULL.
Yep. ~/.profile is only read by bash. They don't appear if you're
using a GUI app, or another shell such as tcsh.
within a cocoa application I ask it to print the value of PATH
environment
variable, it prints "/bin:/sbin:/usr/bin:/usr/sbin:/Users/marcos.
Where is the
PATH environment variable read by cocoa applications having its
value set?
Short answer:
~/.MacOSX/environment.plist
Long answer:
http://developer.apple.com/qa/qa2001/qa1067.html
sherm--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden