parse an environment file

Chris Angelico rosuav at gmail.com
Mon Oct 1 00:20:55 EDT 2012


On Mon, Oct 1, 2012 at 10:11 AM, Jason Friedman <jason at powerpull.net> wrote:
> $ env
>
> produces about 100 entries, most of which are provided by my .bashrc;
> cron provides only a limited number of environment variables.
>
> I want my python 3.2.2 script, called via cron, to know what those
> additional variables are.  How?

Looking into my crystal ball, I'm wondering if perhaps what you're
asking is for your cron job to have environment variables that aren't
set by cron, ones that you can see in your bash environment. This is a
common issue (usually with $PATH), and by no means Python-specific. A
quick web search will bring up some results, for instance:

http://www.google.com/search?q=cron+environment+variables
http://duckduckgo.com/?q=cron+environment+variables
http://www.bing.com/search?q=cron+environment+variables

If this isn't what you're asking about, please consider clarifying
your question :)

Chris Angelico



More information about the Python-list mailing list