• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
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?


  • 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


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

  • Prev by Date: How to make cocoa apps read environment variables set in /etc/profile or /etc/bashrc?
  • Next by Date: Re: sychronizeFile Problem
  • Previous by thread: How to make cocoa apps read environment variables set in /etc/profile or /etc/bashrc?
  • Next by thread: redirecting delegates
  • Index(es):
    • Date
    • Thread