Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: How to make cocoa apps read environment variables set in /etc/profile or /etc/bashrc?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to make cocoa apps read environment variables set in /etc/profile or /etc/bashrc?



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


References: 
 >How to make cocoa apps read environment variables set in /etc/profile or /etc/bashrc? (From: email@hidden)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.